summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/env.h
Commit message (Collapse)AuthorAgeFilesLines
* Drop map_shadow, use a bitmap and update it incrementally.Adam Borowski2013-12-041-2/+1
| | | | | | | | | | | | | | | | | Copying the whole map_knowledge every turn was really costly. We don't care about any fields of the map other than the "seen" flag, too. Thus, we can move it into a bitmap and update only changes rather than everything. This means we need to update the entire bitmap once exploration starts, but that's a small fraction of the cost: qw profiles: before: 9.55% check_for_interesting_features() 0.18% start_explore(bool) after: 0.29% start_explore(bool) 0.10% check_for_interesting_features()
* Don't impose TSO penance for reflecting poison/draining (you still get xp).Adam Borowski2013-10-281-1/+1
| | | | This introduces a new pseudo-agent, akin to ANON_FRIENDLY_MONSTER.
* Fix a (marshalled!) infinite leak in the Abyss.Adam Borowski2013-10-241-1/+0
| | | | For added insult, nothing used that list anymore.
* Allow map forgotten via X^F to be restored with X^U.Adam Borowski2013-07-151-2/+6
|
* Implement cloud alpha overlay tiles layerPete Hurst2013-05-251-0/+2
| | | | | | | | | | | This works very well for the most part with two small problems: - Webtiles will not support this yet (in probability, this will stop any clouds showing in webtiles) - Floor items interact strangely and will draw over the top of clouds instead of behind them
* Track unique tags while placing subvaults (#6328).Zannick2013-01-011-0/+2
|
* Mark unique subvaults temporarily used (#6328).Zannick2012-12-301-0/+3
| | | | | | Committer note: uniq_TAG and luniq_TAG still don't work properly with subvaults, but this at least fixes the multiple-silver-rune problem (and also duplicate quadrants in grunt_profane_halls).
* Remove unnecessary includes from header files.Jay3.14152012-10-231-1/+0
| | | | | | | | | | For most header files, this only saves on having to recompile a small number of source files, but there are also a few headers where small changes would now take significantly less time. This is most obvious for the Tiles build for which the dependencies have been greatly reduced, so that the only additional includes when compared to console are strictly library or tile related.
* Note the vault and subvaults being placed when a crash happens.Adam Borowski2012-10-151-0/+3
|
* Fix subvault give-back not working properly on failures of the host vault.Adam Borowski2012-10-151-1/+7
| | | | | | | Subvaults were registered as used the moment SUBVAULT clause resolved, without a way to undo that registration (except for the whole level being vetoed). The host vault was then properly given back, possibly resulting in the subvault being exhausted if it had no allow_dup.
* Fix two crasher bugs when walking long enough in the Abyss.Adam Borowski2012-09-221-0/+1
| | | | | | | | | | | _you_vault_list would overflow once you found 256 vaults that got shifted away. env.props["level_{vaults,extra}_key"] could potentially overflow as well, although the latter would require running with an amulet of statis on as abyssal "new area" teleports cleared that prop. This commit also fixes Pan vault info keeping only the last level generated; Pan char dumps get quite spammy now. Perhaps refcounting them would be better?
* Object-orient final_effect.Neil Moore2012-09-081-1/+2
| | | | | | | | | This is mostly to avoid the bit-packing of the previous commit. Admittedly, it's a bit overkill for that. This could probably use some cleanup: currently we store attacker, defender, and position in the base class, even though not all subclasses have those.
* Use unique_ptr instead of auto_ptr (emulated for non-C++11).Adam Borowski2012-08-281-1/+1
| | | | | | This stops the tons of warnings, while allowing building for both old and new C++ standards. And if we wanted to use shared_ptr or something, now we can without being ambiguous.
* Use std namespace.Raphael Langella2012-08-261-10/+10
| | | | | | | | | | | | | 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.
* New option: show_travel_trail.Florian Diebold2012-07-041-0/+2
| | | | | | | | | | This highlights the path taken during the last exploration or travel, and should help make travel_delay=-1 less disorienting. The path is cleared when the player moves otherwise. In console, it is indicated with COLFLAG_REVERSE, which I'm not sure is the best option, but just changing the floor colour didn't seem noticeable enough.
* Let Sunlight linger for a while, don't track monsters with spotlights.Adam Borowski2012-06-051-0/+1
| | | | | | | | | | | | | It was strange that the light would magically follow everyone who was in the initial spot for a duration -- with five independent spotlights no less. Sunlight now creates a stationary halo instead. Evaporating water is no longer instant, but the area potentially evaporated is bigger, to compensate. The old cross-shaped area is guaranteed, the rest of haloed stuff (ie, corners of the 3x3 space) have a 50% chance. Also, the 1/100 chance to spawn a plant per evaporated square of shallow water is no more, it was too obscure.
* Merge branch 'master' into portal_branchesAdam Borowski2012-03-261-2/+2
|\ | | | | | | | | This includes fixes for 64834896234968 places in master that add new uses of LEVEL_FOO and so on.
| * Declare an explicit type for colours.Adam Borowski2012-03-131-2/+2
| | | | | | | | | | | | | | | | | | | | An imperial buttload of places assumes these to be 8 bits, which makes it impossible to add support for 256 (or more!) colours. This commit tries to allow expanding it in the future; sadly, it is badly incomplete. At least, new code can use the new type. Also, beware of "branded" colours which use bits above 8 for inverse, underline, etc.
* | Merge branch 'master' into portal_branchesAdam Borowski2012-02-201-0/+3
|\|
| * A temporary speed-up to actor_by_mid().Adam Borowski2012-01-051-0/+3
| | | | | | | | | | | | | | | | It can be done better, but for now, I prefer a simpler solution. This can be turned into an efficient no extra memory hash, etc, later. Also, this is the only non-debug interface so it's trivial to change the implementation.
* | Cache absdepth0, now that it has to be calculated.Adam Borowski2012-01-031-0/+1
|/ | | | | The cached value intentionally is stored in env.absdepth0 rather than you.absdepth0 to catch attempts to modify it.
* Fix most of data loss of tile information in console games.Adam Borowski2011-12-161-0/+4
| | | | | | | | | | All platforms we support in 0.10 allow freely going tiles<->console, loading or creating a save in console should still keep everything needed to display tiles intact. Left to go: * monsters with multiple tiles * player dolls
* Make tile enums available in console builds.Adam Borowski2011-12-141-2/+0
| | | | The actual data isn't loaded or preserved yet.
* Cache position of the Orb.Adam Borowski2011-08-251-0/+1
| | | | It is referenced many times for every monster per turn in ZotDef.
* Cache whether any passages of Golubria or glowing molds are present.Adam Borowski2011-08-251-0/+3
| | | | | Checking for those every turn costed 1% CPU time each on unwoken_rest, and more on an empty level.
* Store vault-defined tile names in the save.Johanna Ploog2010-12-311-0/+1
| | | | | | | Only happens in tiles builds and they're also not saved when going Tiles -> console -> Tiles. TODO: tile_default floor/wall settings
* Let "anon friendly monster" mindices provide a valid monster/actor.Adam Borowski2010-12-261-1/+1
| | | | | This also lets them work with the new monster id system, as it's likely they will be used together unless we decide to migrate completely.
* Convert env.level_layout_type into std::set<std::string> level_layout_types.Vsevolod Kozlov2010-12-141-1/+1
| | | | | This lets one layout specify multiple layout types, which can be useful in combination with layout_* vault tags. Nothing uses this as of yet.
* Move the static mapshadow to a member of envRaphael Langella2010-11-081-0/+2
| | | | | This is to avoid having several static shadow maps in different place of the code.
* Ashenzari: give constant exploration piety per level.Adam Borowski2010-10-081-0/+1
|
* Turn "final effects" into a generic system. Fix water elec not working for ↵Adam Borowski2010-09-241-0/+3
| | | | monsters.
* Rename class "monsters" to "monster".Robert Vollmert2010-09-051-1/+1
|
* Rename chars used as numbers to int8_t/uint8_t. Fix some other type usage.Adam Borowski2010-07-301-2/+2
| | | | | | | | | | This should help against the signed char problems, and is good for code readability. Now, if you have a char, it's either an untyped in-memory byte, or a symbol inside a string. Small numbers are instead [u]int8_t, ints, an enum type, or, in so many cases, bools. I didn't touch any of the tiles code, as it's currently broken and I don't want to risk making it unbroken harder.
* Remove env.show in favor of using env.map_knowledgeLuca Barbieri2010-07-291-4/+2
| | | | | | | | | | | | | | Currently env.show stores information about the LOS rectangle, while env.map_knowledge stores the rest of the map. This unnecessarily complicates the code, makes serialization harder, and makes it hard to change the LOS model. This code uses map_knowledge for both kinds of data. Regressions are quite possible. Signed-off-by: Robert Vollmert <rvollmert@gmx.net>
* A compile option (-DDEBUG_GLOBALS) to let valgrind act on global classes.Adam Borowski2010-07-191-0/+3
| | | | | | It's not the default, even for debug builds, since it makes debugging with gdb nasty -- you have to refer to real_you->field when gdb mentions you.field. Even naming real_you just you would still force you to use "->" instead of ".".
* Use a "tgrid" so we don't have to look up traps or shops linearly.Adam Borowski2010-07-021-0/+1
| | | | | | | | | | | | | find_trap() used to take over 10% CPU in sprint. The main optimization here is bailing out early when grd() says there is no trap -- just that cuts the effort by a factor of several hundred. That makes making the loopup O(1) mostly moot, but I included it anyway since tgrid costs just 11KB of memory. To not risk breaking something for the release, if tgrid is invalid, the list of traps/shops will be searched the old way.
* Delayed level actions -- basic functionality.Adam Borowski2010-06-261-0/+3
|
* Increase item limits, decouple NON_foo from MAX_foo; save major version changed.Darshan Shaligram2010-06-221-1/+1
| | | | | | | | | | | | MAX_MONSTERS: 350 -> 700 MAX_ITEMS: 600 -> 1000 MAX_CLOUDS: 180 -> 600 MAX_TRAPS: 100 -> 400 MAX_SHOPS: 25 -> 100 Untied NON_MONSTER, NON_ITEM, EMPTY_CLOUD from the values of MAX_MONSTER, etc. so that MAX_MONSTER and friends can be changed without breaking save compatibility again.
* Use a #define instead of hardcoded 20 for the size of Pan mons_alloc, reduce ↵Adam Borowski2010-06-201-1/+1
| | | | that to 10.
* Make a few flag types use non-ambiguous storage.Adam Borowski2010-06-201-5/+5
|
* Add support for vaults in the Abyss, save vault metadata in the level save.Darshan Shaligram2010-06-061-0/+17
| | | | | | Vault metadata that was previously discarded at level generation time is now saved in the level file instead. This can be quite costly (~30k per level) if the level has large vaults. The abyss can now use vaults as general scenery (tagged "abyss") or to place the rune ("abyss_rune"). abyss.des currently includes stub vaults for testing.
* Save old player position (env.old_player_pos).Robert Vollmert2010-06-051-1/+6
|
* Abyss code cleanup.Darshan Shaligram2010-06-051-1/+3
| | | | | | | | Clean up the code involved in generating and shifting the abyss. This is spadework in preparation for abyss vaults. Fixes abyss shifts copying the area around the player to the centre of the abyss and not clearing the old area (irc conversation between Linley and dpeg confirms that the old behaviour of not clearing the duplicate shifted terrain is a bug). Fixes abyssal runes being more likely to appear at the NW of the abyss level, particularly as time spent in the abyss increases.
* Use tileidx_t for tile indices. Also, cleanup.Enne Walker2010-05-301-3/+3
| | | | | | | | This new type defines to unsigned int, but it cleans up a lot of the int/unsigned int/short confusion all over the codebase for tile indices. This commit also cleans up tiles code to use coord_def more and to change function signatures to pass const refs and non-const pointers.
* Awaken Forest, a spriggan druid spell.Adam Borowski2010-05-181-0/+1
|
* Changed structs that acted like classes to classesIxtli2010-05-041-1/+0
| | | | | Anything that had more than constructors, const or static member functions, or operator definitions were considered acting like classes.
* Extend time counters from 23 bits (float) to 31 bits (int).Adam Borowski2010-02-041-1/+1
| | | | | | | | | | | In most places, they were stored as doubles (mantissa of 52 bits), but often passed as floats (mantissa 23 bits). Such bugs were present in stabwound's 92M turns game but in that version of Crawl we didn't use absolute counters for much and turn count was (and is) an int so nothing was visibly broken. In current Crawl, it would either crash or trigger an assert due to counters not adding up. This commit drops all abuses of double to store integer values.
* Save Shoals heightmap in level tag, increment tag minor version.Darshan Shaligram2009-12-271-0/+3
|
* Move trap_def from externs.h to trap_def.h.Robert Vollmert2009-11-271-0/+1
|
* Remove unused crawl_exit_hook.Robert Vollmert2009-11-201-2/+0
|