summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/database.cc
Commit message (Collapse)AuthorAgeFilesLines
* Remove stuffNicholas Feinberg2014-07-291-0/+1
| | | | | | | .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!
* Add end.ccNicholas Feinberg2014-07-281-1/+1
|
* Allow toggling monster speech diagnostics in &^QNeil Moore2014-07-081-1/+1
| | | | | This is currently predicated on DEBUG_MONSPEAK, since all the relevant messages are.
* A popular 4.1ism: Titles for uniques.Steve Melenchuk2014-06-011-0/+1
| | | | | | | | | Boris, Master of Life and Death comes into view. Currently displays only on the describe screen and on the unique coming into view by itself. Special thanks to the team on ##crawl-dev that helped assemble these.
* Disable multithreaded loading on Windows (#5354).Steve Melenchuk2014-04-061-2/+5
| | | | | Until we can identify why it randomly fails to find files, we should not have the game crash on startup.
* 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.
* Indentation fixes.Adam Borowski2013-12-041-1/+1
|
* Replace `mpr(s, ch)` with `mprf(ch, s)`Adam Borowski2013-11-291-4/+4
| | | | | | | | | Also simplify quite a few cases. It turns out in >90% cases of non-literals the argument had .c_str(), which meant it was pointlessly malloc()ed and converted from and to std::string. I believe a sprintf is faster, so even the argument of miniscule speed-up doesn't apply.
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-1/+1
|
* Move quotes back to their own resource file.Raphael Langella2013-09-111-4/+9
| | | | This commit partially reverts 45418d04c5e6913acaf493027d765c495609bdd
* Convert several instances of "and" "not" and "or" to "&&" "!" and "||" (xFleury)Pete Hurst2013-05-191-1/+1
| | | | These are in the standard but break on MSVC.
* Move quotes to description files.Raphael Langella2013-03-191-9/+4
| | | | | | | | | | This should simplify the transifex interface and make it easier to allow contributers to add new quotes. It's not possible to have a translated key without a source key in transifex. So when there is a translated quote but not an english quote, I've used the foreign quote in place of an english one to be able to push it to transifex. This seem acceptable as we used to have foreign quotes before we started translations. Feel free to replace them with english quotes.
* Allow "%"PRI to build in C++11 mode.Adam Borowski2012-08-281-2/+2
| | | | | | | | | | | This is a misdesign in the standard, the committee is debating whether it's a defect or not, we'll know the result in ten years or so. In the meantime, gcc-4.8 and clang(version?) added a fix so formerly legal code compiles (but with a warning...). This fix is not yet in gcc-4.7 nor clang-3.1, and since failing to build on compilers that happen in the wild is a bad idea, let's kludge it around with spaces. More info: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52538
* Use std namespace.Raphael Langella2012-08-261-106/+100
| | | | | | | | | | | | | 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.
* Some more return deparenthesization.Adam Borowski2012-07-051-1/+1
|
* String scalars are scalars, too.Adam Borowski2012-07-051-1/+1
|
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-6/+6
|
* Put tutorial messages for tutorial 5 into the database.Adam Borowski2012-06-281-0/+1
|
* Make a database to store hints mode messages.Adam Borowski2012-06-261-0/+13
| | | | This commit adds only a few, transferring the text will be a lot of work.
* Fix "monster" crashes more generally.Neil Moore2012-06-231-4/+6
| | | | | | | | The command "monster-trunk pandemonium lord" was crashing on a call to getLongDescription(). Push the already-present no-database handling in _getWeightedString() even further down, into _database_fetch(). This reverts commit 22a6ff26fb0f47fe232839e15d7064220e9b60cf.
* Require db aliases to have no < inside.Adam Borowski2012-06-111-1/+2
| | | | | | | This should remove any cases where something coloured would be taken for an alias, as there's no point in a colour code but no content. This is an equivalent of /^<[^<\n]*>\n$/s.
* Kludge around coloured database entries not showing.Adam Borowski2012-06-091-1/+2
| | | | | | | One-line ones are still broken, this kludge assumes everything that matches /^<([^\n]*)>\n$/s is an alias reference. The choice of syntax wasn't most fortunate...
* Revert "Shush another compiler warning.", replace it with inttypes.h macros.Adam Borowski2012-05-261-2/+2
| | | | | | | This warning is correct -- you're feeding a 64 bit value to a format specifier that can mean either 64 or 128 bits, depending on platform. This reverts commit f142bfad6f59f60829fc1980bb4178f51e6a651a.
* Kill some longs.Adam Borowski2012-05-261-2/+2
| | | | | | 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.
* Add an alias functionality to database lookups.Raphael Langella2012-05-151-0/+7
| | | | Putting <foo> in a database entry redirects to key foo.
* Separate bulleted items in FAQ entries by empty lines in the source.Adam Borowski2012-05-111-1/+9
| | | | This allows using the same transifex scripts as for descriptions.
* Move god lastnames to dat/database/ rather than dat/descript/Adam Borowski2012-05-021-20/+1
| | | | | Transifex scripts assume the former all follow the desc rules, this one follows the db ones.
* Move quotes.txt to dat/descript/Adam Borowski2012-04-291-1/+1
| | | | | | | | | They follow all the rules for descriptions, so we can translate them using the same tools. The only difference is that they are not mandatory. I guess, if a given language has at least one quote defined, we could skip the fallback to English for the rest.
* Evict pizza toppings to the database.Adam Borowski2012-04-151-1/+4
| | | | | This including being vegetable or not, so different translations can have pepperoni mean different stuff.
* Use enums rather than string comparison for fake languages.Adam Borowski2012-04-131-18/+18
| | | | | | It was good enough for a single day throw away joke. Also, don't store a copy of the language for every db object.
* Avoid another "monster" crash.Neil Moore2012-04-051-4/+3
| | | | | | Silver statues use the MiscDB (via weird_glowing_colour() -> getMiscString()). Detect missing databases in _getWeightedString() instead, to catch both this and the previously-handled queries.
* Fix "monster" crashing on Roxanne (randart spellbook).Adam Borowski2012-03-291-0/+4
| | | | It has no way to access the database.
* Revert "A bit of debug info about loaded translations, to help investigate CDO."Adam Borowski2012-03-291-6/+0
| | | | | Investigation done, breaking of all games without "language=pl" done as well. This reverts commit b65c0c250055b6b981a596c6369db8fef670e04f.
* A bit of debug info about loaded translations, to help investigate CDO.Adam Borowski2012-03-291-0/+6
| | | | | Somehow, they fail to load there, and I can't seem to be able to reproduce that locally, even in DGL mode.
* Fix an use-after-free potential crash.Adam Borowski2012-03-271-2/+3
| | | | That's inside multithreaded code, so it's worse than it looks.
* Hush a warning in DGL builds.Adam Borowski2012-03-271-0/+2
|
* Don't crash when a help topic is missing.Adam Borowski2012-03-251-1/+4
| | | | This doesn't solve the problem, merely a symptom.
* Fix fallback to English not working in incomplete translations.Adam Borowski2012-03-191-2/+2
|
* Let description search work on translated (only) text.Adam Borowski2012-03-191-1/+9
| | | | | | Preferably, we'd look for English text if an item lacks its translation, but it's non-trivial with DBM. Not sure if it makes sense to even bother with it (sqlite could be mandatory), but for now, this may be good enough.
* Fix apparent typo in database lookups.David Lawrence Ramsey2012-03-181-1/+1
|
* Use translations when querying a weighted string from the database.Adam Borowski2012-03-181-28/+22
|
* Fix database[en] being rebuilt every time if database[X] exists and is enabled.Adam Borowski2012-03-171-4/+6
|
* When a translated database exists, query it first, falling back to English.Adam Borowski2012-03-171-25/+23
| | | | In other words, this enables the first set of translated strings, WHEE!!!
* Build databases for the selected translation as well.Adam Borowski2012-03-171-17/+62
| | | | | Any files can be missing; if all components of a database are missing no .db is created at all.
* Detect db timestamps going backwards.Adam Borowski2012-03-161-13/+15
| | | | | | | This happens whenever someone downgrades his version in non-git builds (most other tools preserve timestamps). Note: this does not fix the identical problem with .des files!
* Separate db input files from their path.Adam Borowski2012-03-161-49/+52
| | | | This will allow looking for directory/$LANG/file.txt
* Allow logically wrapped quotes as well.Adam Borowski2012-03-081-1/+1
| | | | | | | | None of them needed to be changed. There's ugliness: a quote that needs to be wrapped will not have its subsequent lines indented, but that's not a regressions as all current overlong lines exhibit this behaviour. Still, something to fix soon.
* Allow descriptions (dat/descript/*.txt) to be logically wrapped in the sources.Adam Borowski2012-03-081-1/+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.
* Evict unrand descriptions into the database.Adam Borowski2012-03-081-0/+1
|
* Make a bunch of functions static.Adam Borowski2012-03-071-21/+14
| | | | As usually, a good percentage of them turn out to be unused.