summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.h
Commit message (Collapse)AuthorAgeFilesLines
* Refactor.Nicholas Feinberg2014-08-141-55/+0
|
* Fix strlcpy check (reaverb)Neil Moore2014-07-301-1/+0
|
* Remove stuffNicholas Feinberg2014-07-291-96/+17
| | | | | | | .cc, moving its contents into the new stepdown.cc and strings.cc. (The latter also got many donations from libutil.h.) Down with stuff! Up the new flesh!
* Remove some duplicate code.Neil Moore2014-07-131-0/+11
| | | | | | We had a template to compare pairs by their second member, and two separate classes to do the same thing for specific pair types. Remove the non-generic versions, and move the template to libutil.h.
* Avoid conflict with libraries' HAVE_*Neil Moore2014-07-121-1/+1
|
* Avoid a signed/unsigned warning.Neil Moore2014-07-121-1/+1
|
* Add a useful predicate for find_earliest_match.Neil Moore2014-07-121-0/+2
|
* Prefer closer prefixes in find_earliest_match.Neil Moore2014-07-121-6/+12
| | | | | | If multiple strings contain the spec as a prefix, choose the shortest such string, so that a spec of "vamp" prefers "vampire" to "vampire bat".
* Refactor god and spell search using templates.Neil Moore2014-07-111-0/+48
|
* Don't redefine strlcpy if it already exists.Neil Moore2014-05-311-0/+6
| | | | | | | Check for strlcpy at compile time and define our version only if necessary. This should fix recurrent warnings on Macs (and probably other BSDs).
* Drop tagstring.{cc,h}Adam Borowski2013-11-291-0/+1
| | | | A whole file for four lines of code.
* More formatting fixes for return (...);Neil Moore2013-11-151-2/+2
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-5/+5
|
* Allow easily aborting mapstat.Adam Borowski2013-10-131-0/+1
| | | | Ctrl-C should probably be enabled during database rebuild, too.
* Brace and std:: removal.Adam Borowski2012-12-081-4/+0
|
* Split MOUSE_MODE_MORE into versions for prompts, to give the Webtiles client ↵Florian Diebold2012-11-231-2/+2
| | | | more information.
* Webtiles: Implement the "new command" marker for messages.Florian Diebold2012-11-231-0/+13
|
* Fix prompts asking for 'I' in Turkish locales.Adam Borowski2012-11-221-0/+5
| | | | | | | They have I<->ı and İ<->i. Fortunately, people are quite unlikely to type capital letters in response to prompts, perhaps save for the stat gain one.
* Make isa[ctype]() return bool.Adam Borowski2012-11-221-5/+5
| | | | Not that there's a big difference...
* 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.
* Add spelling fixes.David Lawrence Ramsey2012-10-121-1/+1
|
* Improve speech syntax: capitalization and random substrings.Jay3.14152012-10-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. @The_monster@ shouts, "I hate you, @CAPS@ @player_name@ @NOCAPS@!" will result in the actual player name being capitalized. (Spaces are trimmed.) 2. @The_monster@ says, "I am [very ||really ] hungry." will randomly result in "I am very hungry", "I am hungry" or "I am really hungry". If the pattern turns up a lot, you need to assign weights to the different choices, or you require nested random sets, you'll need to stick to the old fallback of defining ad hoc @keywords@. Otherwise, this should make things somewhat simpler. Works for both monster and weapon speech, including shouts, noisy weapons and the Singing Sword. I've also taken the liberty to update the speech documentation, which still listed the old website (!) and pointed users looking for advice to the newsgroup). Conflicts: crawl-ref/source/art-func.h crawl-ref/source/libutil.cc crawl-ref/source/libutil.h Signed-off-by: Florian Diebold <flodiebold@gmail.com>
* Use std namespace.Raphael Langella2012-08-261-60/+48
| | | | | | | | | | | | | 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.
* Make inline functions static.Adam Borowski2012-08-091-1/+1
| | | | | | | | | This avoids unnecessary non-inlined copies. Also, we had a few large functions that had no reason for inlining, let's have them be regular ones. I also made "static inline" always use the same order, for easier grepping.
* Fix conflicting declarations of ends_with().Adam Borowski2012-08-091-3/+1
| | | | | For historical reasons (and a C99 misdesign), the compiler doesn't complain, but it still doesn't make it right.
* Make a couple inlined functions static.Adam Borowski2012-07-311-2/+2
| | | | Without that, the compiler will add useless non-inlined copies.
* Weak-ass text popup for --help on Windows tiles.Adam Borowski2012-07-161-0/+1
| | | | | | | | | It uses MessageBoxW() which has two flaws: * you can't copy&paste text * columns are badly misaligned I guess the former is what Windows users are already used to, but the latter looks abysmal.
* Merge branch 'lightning_rod'Adam Borowski2012-07-051-0/+8
|\ | | | | | | | | | | | | | | | | | | There are some design issues, and the damage might be out of whack, but it looks like rods of smiting are universally hated, so let's push this in, and if testing shows problems, we can disable lightning and at least not have to suffer smiting. For damage, there are conflicting reports: both "too weak" and "too powerful", which suggests it might be actually ok.
| * Rod of lightning.Adam Borowski2012-06-221-0/+8
| | | | | | | | | | | | | | | | | | | | [Unfinished: no actual damage yet.] A single zap uses only two mana, evoking it in subsequent turns will take 5 (or less if the rod is spent), spreading the damage upon the whole arc between, with a boost if you're not aiming at the same place. Releasing the trigger (ie, doing any action other than evoking the rod) will stop the discharge.
* | Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-1/+1
| |
* | Fix a bunch of webtiles-in-console message regressions.Adam Borowski2012-06-221-0/+2
|/ | | | | | | | | This is nowhere close to completeness, I got tired early through that massive file, pushing it to see if you guys have any comments about what is the best way to proceed. In particular, I think command tags and item glyphs could be done a better way.
* Preserve indentation when wrapping a line.Adam Borowski2012-04-021-1/+2
| | | | | | | | | | | | | Quotation marks are considered to be indentation, so paragraphs are wrapped like this: “Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.”
* Make it impossible to wait out or re-roll Sage cards you don't want.Adam Borowski2012-03-271-0/+8
| | | | | | | They redirect a certain amount of xp. Multiple cards work concurrently, diluting each other but not affecting the total amount of xp redirected. Need a formula for how much to redirect.
* Make another bunch of functions static or deleted.Adam Borowski2012-03-211-2/+0
| | | | | Looks like get_XXX_path and the like in files.cc could use some drastic simplification, or perhaps even a nuking and rewrite.
* Allow descriptions (dat/descript/*.txt) to be logically wrapped in the sources.Adam Borowski2012-03-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | Without this, they had to be stored in enormous long lines, nigh impossible to read and tedious to edit -- or pre-wrapped, which wastes space and looks ugly on terminals wider than 80 columns. They are unwrapped upon being displayed now, giving us the best of two worlds. Existing descriptions (bugs aside) never used pre-wrapping, although they often do consist of paragraphs separated by an empty line. (Cards and "buggy god" descriptions are exceptions, but "usually found in" parts should be autogenerated anyway, as we risk them becoming outdated.) New formatting rules: * regular text is re-wrapped * an empty line separates paragraphs * indented lines keep their breaks (used in most quotes) * you can force a newline with literal "\n" The last one is unused, merely a quirk of the conversion, and may be not the best idea -- keeping it for now to allow you to force newlines if needed.
* Replace a bunch of floating-point sqrt()s by integer ones.Adam Borowski2011-11-131-0/+3
|
* Make a bunch of functions static, delete some unused junk.Adam Borowski2011-11-111-3/+0
|
* Mostly correct uppercasing/lowercasing of Unicode strings. ij and ß are ↵Adam Borowski2011-10-011-15/+2
| | | | | | | | | still wrong. Ok, I can understand Germans having ß as a lowercase-only letter which can be at most approximated with SS/Ss when uppercased, but Dutch ij rather than ij is plain stupid. And it requires a thorough reworking, needing special libc functions just for one alleged "letter".
* Add ench: and perm_ench: to MONS specs.Adam Borowski2011-09-281-0/+1
|
* Add more printf warnings (SamB).Adam Borowski2011-09-211-1/+1
|
* Combine common parts of lib*.hAdam Borowski2011-09-081-6/+0
| | | | | Having different prototypes for different ports without a good reason is bad. After unification, it's easier to have, for example, two ports at once.
* Use standard strcasecmp() rather than Microsoft-only stricmp().Adam Borowski2011-09-071-3/+0
|
* Don't show scary warnings when upgrading trunk saves.Adam Borowski2011-07-211-0/+2
| | | | Not being able to go back is expected.
* Show some internal info about saves.Adam Borowski2011-06-081-1/+2
|
* Put usleep() emulation into syscalls.ccAdam Borowski2011-06-041-4/+0
|
* Gut and parcel out most of stuff.ccAdam Borowski2011-06-041-0/+5
|
* Optimize invalidate_los_around().Adam Borowski2011-05-281-0/+5
| | | | | | | | | | It's the biggest CPU hog on the sprint rest test, especially its unwoken version. Changes: 1. no use of iterators (the other biggest hog, which one deserves the title is unclear due to them being entangled) 2. a π/4 optimization: no need to clear corners of a rectangle
* Handle SIGHUP in tiles and on Windows.Adam Borowski2011-05-011-0/+1
| | | | (Ok, ok, on Windows it's a ConsoleHandler but does basically the same).
* Warn and allow aborting when transferring a 0.8 game to 0.9.Adam Borowski2011-04-241-0/+1
| | | | | There's no going back so the player deserves a warning. Before, we simply made saves incompatible, but if we can keep compatibility, it can be nice.
* Drop remnants of the DOS port.Adam Borowski2011-04-081-1/+0
| | | | | | | | | It's broken since 0.5 (where it "just" had a long-unfixed bug with infinite mana), in 0.6 doesn't even compile and in 0.8 took a number of other tedious to port blows. If no one stepped up to revive it, no one probably ever will. DOS is an ancient coprolith, too, and can't really handle the bloat Crawl has. As a side effect, I made *h and /h work on Windows.