summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.h
Commit message (Collapse)AuthorAgeFilesLines
* Function to open and lock new files only.Neil Moore2014-05-271-0/+1
| | | | Currently unused, but there are plans.
* Remove some unused parameters.Neil Moore2014-05-271-1/+1
|
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-2/+0
| | | | | Sometimes, they're there to emphasize a break between two sections of code, which is good. In a majority of cases, though, they're just inconsistent.
* Remove sighup_save_and_exit().Adam Borowski2013-11-251-2/+0
| | | | | | | | | | As the comment said, every single use of this function was a save-corrupting bug. Too bad, there's one case left: on Unix, HUP will fclose(stdin), which can immediately fail due to fclose() using malloc (free() to be exact), and then it still relies on undefined behaviour which sometimes works only because ncurses does weird things behind our back.
* Remove unnecessary includes from header files.Jay3.14152012-10-231-1/+2
| | | | | | | | | | 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.
* Use std namespace.Raphael Langella2012-08-261-45/+38
| | | | | | | | | | | | | 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.
* Kill some longs.Adam Borowski2012-05-261-1/+1
| | | | | | In portable code, basically every use of long or %ld/%lu/%lx is a bug. A legitimate use in Crawl is the bit array: storing it in-memory should be preferably done a word at a time.
* Merge branch 'master' into portal_branchesAdam Borowski2012-03-261-10/+1
|\ | | | | | | | | This includes fixes for 64834896234968 places in master that add new uses of LEVEL_FOO and so on.
| * Embed the timestamp into des cache files instead of relying on the filesystem.Adam Borowski2012-03-231-1/+1
| | | | | | | | | | This allows detecting input files going backwards -- ie, with any non-git downgrade.
| * Make another bunch of functions static or deleted.Adam Borowski2012-03-211-7/+0
| | | | | | | | | | Looks like get_XXX_path and the like in files.cc could use some drastic simplification, or perhaps even a nuking and rewrite.
| * Axe a stray prototype for an ex-function.Adam Borowski2012-03-161-2/+0
| | | | | | | | It joined the choir invisible years ago.
* | Merge branch 'master' into portal_branchesAdam Borowski2012-02-201-11/+0
|\|
| * Get rid of SavefileCallback.Adam Borowski2012-02-071-11/+0
| | | | | | | | | | | | | | | | They had one legitimate user that could be called from a single place (as opposed to two callbacks) together with many other similar initializations. 2/3 of code served for compiler/platform differences -- explicitely declared by the language standard as undefined behaviour.
* | Fix losing stash data upon a trip to the Abyss or a Ziggurat.Adam Borowski2011-11-041-0/+1
| |
* | Get rid of one of redundant (and buggy) ways to track existing levels.Adam Borowski2011-11-041-7/+0
|/
* Rename load() to load_level(), the former is totally ungreppable.Adam Borowski2011-10-111-2/+2
|
* Prevent des cache collisions by using path to file.Aaron Becker2011-08-311-0/+1
| | | | | | | Cached map information previously just used the name of the map file, so that for example entry/large.des and variable/large.des would collide in the cache. Instead, produce cache entry names that use the full path of the file relative to the des directory, entry_large.des and variable_large.des.
* Make a bunch of functions static or non-existant.Adam Borowski2011-08-171-2/+0
|
* Old #ifdef purge: USE_FILE_LOCKING.Adam Borowski2011-05-011-2/+0
| | | | | Skipping this just causes corruption if you start Crawl twice, and it was not supported only on DOS.
* Handle SIGHUP in tiles and on Windows.Adam Borowski2011-05-011-0/+2
| | | | (Ok, ok, on Windows it's a ConsoleHandler but does basically the same).
* Simplify save file name logic now that uids are gone.Adam Borowski2011-04-291-8/+2
|
* Properly handle saves whose name doesn't match the character.Adam Borowski2011-04-291-2/+2
| | | | Before, they would show up but start a new game after choosing them.
* Offer to delete incompatible saves.Adam Borowski2011-04-291-1/+1
| | | | | Declining this question currently exits, which is suboptimal. It should be probably merged with any other error when loading a game, though.
* Detect incompletely regenerated databases.Adam Borowski2011-04-191-3/+0
| | | | | | | | | | | | | | | This saves the timestamp in the database instead of relying on the .db file's mtime (which would be newer than source). There are better ways to do this, but I did the simplest one for now, since aborted builds result in very "fun" bugs, and we badly want this fixed for 0.8. Also, there were nice race conditions, multiple rw opens, and so on. The whole database system needs to be rewritten quite badly, it's a mess of layers upon layers, remnants of DBM that was used in the dark past. This is only the db, dsc files suffer from the same problems, and the fix there will be a lot more complex :(
* Work around FreeType having problems opening files on Windows.Adam Borowski2011-04-141-0/+1
| | | | | | | | | | | | | According to its documentation, FT_New_Face() expects the file's name in UTF-8 regardless of the system locale. Too bad, there's a bug where sometimes on Windows an 8 bit code page is used instead: http://www.mail-archive.com/freetype@nongnu.org/msg00939.html Since we don't know if the version we're talking to is fixed or not, it's safer to load the font file ourselves. This fixes cases where zipped (not installed) builds were put into a directory with a non-ASCII name.
* Make file headers doxygen-friendly, drop useless fields.Adam Borowski2011-03-281-5/+4
| | | | | | | "File:" is shown in your editor's status bar. "Written by:" was used only for the first person who changed a file. We got git for that now, and pre-DCSS history is so woefully inaccurate it doesn't really matter.
* Title images: search all title_* files instead of just tile_xx.png.Raphael Langella2011-01-131-0/+1
| | | | Now we can give them proper names.
* Use the level's description ("D:15", "Zot:5", "Pan") as the level's chunk name.Adam Borowski2011-01-091-2/+0
| | | | For bones, '-' is used instead of ':' to handle Windows.
* Implement file locking on Windows.Adam Borowski2010-12-021-1/+1
|
* Drop any chmod() calls from inside Crawl.Adam Borowski2010-12-021-6/+0
| | | | They make sense only for setgid binaries which cause no end of security issues.
* Fix an incorrect comment.Adam Borowski2010-10-211-1/+1
|
* Massive spacing fixes: "( spaces after parentheses )".Adam Borowski2010-10-151-5/+5
| | | | | | I did review it manually to find places where they made sense (like some tables), but for a massive sed job like this there might be places that I missed.
* Fix portal levels not getting deleted [Mantis 2493]Adam Borowski2010-09-081-2/+1
|
* Rip away the multiple tags code.Adam Borowski2010-09-041-1/+0
| | | | | | I especially enjoyed removing that big ALL-CAPS shouting comment telling people to never touch the write/read functions for individual tags. Down with hugely granulated inflexible versioning schemes!
* Store most save subfiles as chunks, except chr, lua, tdl.Adam Borowski2010-09-041-1/+1
|
* Convert ./crawl --save-version to the new format.Adam Borowski2010-09-031-0/+1
|
* Rename chars used as numbers to int8_t/uint8_t. Fix some other type usage.Adam Borowski2010-07-301-1/+1
| | | | | | | | | | 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.
* Allow installations with secure saves share their scores and bones.Adam Borowski2010-07-221-0/+1
| | | | | | | | There is a new compile-time option, SHAREDDIR; it specifies the directory to put the logfile, scores and bones into -- they used to be in SAVEDIR/saves (and that's the default when not specified). A typical layout is SAVEDIR='~/.crawl' SHAREDDIR=/var/games/crawl
* Reimplement all monster-related actions as delayed ones. Remove ↵Adam Borowski2010-06-261-4/+0
| | | | | | | | | apply_to_all_dungeons(). Functional changes: * Yred's penance won't insta-enslave mons you merely marked. * Xom-gifted pet perm daevas won't abandon you if you drop TSO. (I've actually had this happen to me in a real game!)
* Move Sprint saves into $SAVEDIR/sprint.Darshan Shaligram2010-06-191-1/+6
| | | | | | | | | | | | | | | This allows the same character name to have ongoing Crawl and Sprint games without filename collisions. I'm using a subdirectory instead of a filename suffix (such as Foo-501-spr.chr) to avoid blowing DOS compatibility. Add GAME_TYPE_UNSPECIFIED as the uninitialised game_type. It's synonymous with GAME_TYPE_NORMAL, but allows the code to distinguish between a player having chosen the main game and the player not having made a choice yet. get_savefile_directory() returns the current savefile directory based on game type. Direct use of Options.save_dir should be avoided in new code. player_save_info now tracks game type as well.
* [1748] Fix minimap issues with X[.Enne Walker2010-06-171-0/+1
|
* Make Crawl react better to seeing des files and database text files modified ↵Darshan Shaligram2010-06-141-0/+1
| | | | | | | | | | | | | | | | | | and recompiled by new Crawl processes while older processes are running. When mapdef.cc detects that a .dsc file is out of sync, it throws an exception that dungeon.cc catches. dungeon.cc then discards all loaded maps and reloads then from the map index (.idx) files. The old behaviour was to create a panic save and exit for out-of-sync .dsc files, which is not ideal since the panic save code is rarely used and tends to bitrot. When regenerating text database files in DGL installs, the game no longer unlinks the old .db file, and will instead update the old file with the new db keys. None of this code should be relevant to single-user installs.
* Compile .des and database files into a versioned cache directory under the ↵Darshan Shaligram2010-06-131-1/+3
| | | | savedir so that different save-compatible Crawls can share a common savedir while having different data dirs.
* Bring sanity to enums by making them diffable/patchable.Adam Borowski2010-06-081-1/+1
|
* Fix crash when using ^F to travel to an item.Darshan Shaligram2010-06-081-2/+0
| | | | travel_load_map no longer did the Right Thing after my level_vaults changes, tossed it in favour of level_excursion.
* Make load() take level_id old_level.Robert Vollmert2010-06-081-5/+4
|
* [1515] Fix X + [] not reactivating Lua markers after excursion.Darshan Shaligram2010-05-081-3/+3
| | | | | | | | | | | | | | | level_excursion was reactivating Lua markers only if the player was not on the original level when the destructor was called. Since the level-map explicitly does a go_to(original), this is never the case. The fix is to reactivate Lua markers if the level_excursion *ever* moved off-level. This also allows us to dispense with the LOAD_RETURN mode of reloading levels. LOAD_RETURN only served two purposes: to activate markers and then to fire the dungeon event for the player entering the level. However, this event should not be fired for level excursions, because the player never physically left the level, and reactivating markers can be done safely after _load_level returns.
* Quarantine save game checking code in files.{cc,h}.Robert Vollmert2010-04-271-0/+1
| | | | | In particular, checking save existence in newgame is now not responsible for unpacking packaged saves...
* Split up new_game.Robert Vollmert2010-04-231-1/+1
| | | | | | choose_game() is now only concerned with choosing a character, and doesn't touch "you". setup_game() (ng-setup.cc) then fills out "you" and other stuff.
* Move restoring state after level excursion into load().Robert Vollmert2010-03-221-1/+2
|