summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.cc
Commit message (Collapse)AuthorAgeFilesLines
* [212] Fixing prompts clearing screen in tiles.Enne Walker2010-01-031-0/+9
| | | | | | | The line reader was always switching back to GOTO_CRT. When receiving input from the message window, this ended up causing the screen to blank and switch to the CRT layer. Adding a function get the current cursor region allows the line reader to not change regions.
* Properly bracket va_copy() with va_end(). Don't leak saved args.Adam Borowski2010-01-011-1/+3
|
* vmake_stringf: Copy the va_list argument for the second vsnprintf call.Vsevolod Kozlov2009-12-301-1/+4
| | | | | | It needs to be copied, otherwise the second call to vsnprintf will be passed a va_list that has been messed up by the first call, and weird segfaults will occur. (They did for me.)
* Give Lua access to DESC_QUALNAME and DESC_BASENAME.Jude Brown2009-12-281-0/+4
| | | | | These do not seem to leak any information. If so, they can be limited to dlua implementations of item->name.
* Fix bad varargs handling.Robert Vollmert2009-12-171-6/+12
| | | | You can't pass a va_list to a variadic function.
* Use snprintf() on DOS, we don't want crashes. Non-ancient compilers have it.Adam Borowski2009-12-171-36/+0
| | | | | Preferably, we would detect the presence of such functions, but _some_ folks oppose feature tests.
* In make_sprintf(), don't call sprintf() twice if the first call succeeds.Adam Borowski2009-12-171-7/+8
| | | | This spares us the second call, a malloc() and free() in 99.999% cases.
* Make make_sprintf() actually work when there are any arguments.Adam Borowski2009-12-171-0/+2
| | | | | va_begin and va_end let you traverse the list of arguments just once, you need to call them again for another go.
* remove line length limit for .des filesJesse Luehrs2009-12-161-4/+6
|
* cgotoxy now takes GotoRegion instead of int.Robert Vollmert2009-12-101-1/+1
|
* Add formatting fixes.David Lawrence Ramsey2009-11-211-2/+2
| | | | This mostly puts && and || on the proper lines, per the style guide.
* Split up view.cc.Robert Vollmert2009-11-041-1/+2
|
* Whitespace.Enne Walker2009-10-311-2/+2
|
* Adding you.in_branch(string) as a lua function.Enne Walker2009-10-311-0/+26
| | | | | | This also removes you.where_are_you() so as not to require lua scripts to know the value of C++ enums. This change also fixes stricmp incorrectly falling through to strcmp on non-MSVC platforms.
* win32: eliminate need for WIN32TILES/WIN32CONSOLE macrosSteven Noonan2009-10-191-3/+3
| | | | | | | | | | | | | | Instead of defined(WIN32CONSOLE) we should use: defined(TARGET_OS_WINDOWS) && !defined(USE_TILE) As well as replace defined(WIN32TILES) with: defined(TARGET_OS_WINDOWS) && defined(USE_TILE) Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* versioning: remove SVN-specific revision data, add Git versioningSteven Noonan2009-10-181-1/+0
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* project-wide: implement use of platform.h detection macrosSteven Noonan2009-10-101-1/+1
| | | | Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Remove a lot of unneccessary includes.Robert Vollmert2009-10-091-1/+0
| | | | | | | The console version still compiles on Linux; both console and tiles version compile in OS X. I haven't been able to test the DOS and Windows compiles -- please fix or tell me about any errors that show up.
* Drop obsolete CVS last-committed headers ($Author$).Adam Borowski2009-10-061-3/+0
|
* Replace extraneous tabs with spaces.David Lawrence Ramsey2009-10-011-5/+7
|
* libutil.cc: add escape_path_spaces()Steven Noonan2009-09-301-0/+30
| | | | | | | | Spaces need to be escaped in any system() calls, so we have this simple function which escapes spaces with either doublequotes (Windows style) or backslashes (UNIX style). Signed-off-by: Steven Noonan <steven@uplinklabs.net>
* Apply bookofjude's patch in [2837552] to fix "-um" pluralization issues.dolorous2009-08-181-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10566 c06c8d41-db1a-0410-9941-cceddc491573
* Add spacing fixes.dolorous2009-04-301-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9709 c06c8d41-db1a-0410-9941-cceddc491573
* Fix [2700197]: Use "a" instead of "an" for one-headed hydras.dolorous2009-03-211-2/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9525 c06c8d41-db1a-0410-9941-cceddc491573
* Properly pluralize "antenna" as "antennae".dolorous2009-01-191-1/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8566 c06c8d41-db1a-0410-9941-cceddc491573
* Adding REVISION() macro to all source files.ennewalker2009-01-041-0/+2
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8217 c06c8d41-db1a-0410-9941-cceddc491573
* Add arena_force_ai option (also settable as "force_ai" or "no_force_ai" in ↵dshaligram2009-01-031-2/+15
| | | | | | the arena spec) that when unset, uses the real game's monster AI, and when set, forces monsters to attack. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8160 c06c8d41-db1a-0410-9941-cceddc491573
* Two cosmetic-only changes to Xom miscasts:zelgadis2008-12-221-0/+2
| | | | | | | | | | | | | | | 1) For zero-level (message only) miscasts there's a 1 in 20 chance that a non-standard message will be given, like "Your shield spins", "The scales of your dragon armour briefly wiggle", and so on. 2) For all other miscasts the string used for "your hands" will be randomized to only sometimes be normal, to get messages like "Your nose glows momentarily" or "Noxious gasses pour from your feet". This can lead to some bizarre messages like "Sparks play between your ears", but then, this *is* Xom. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7906 c06c8d41-db1a-0410-9941-cceddc491573
* * Add sharks. They go into a battle frenzy if they smell blood.j-p-e-g2008-12-081-3/+3
| | | | | | | | | * Make harpies actually appear in packs. (Oops...) * Properly pluralise hippogriffs as such. * Regard butcher swap prompt as safe and default to 'n'. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7784 c06c8d41-db1a-0410-9941-cceddc491573
* Properly pluralise words ending in "ay", "ey", "iy", "oy" and "uy".zelgadis2008-12-041-1/+12
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7740 c06c8d41-db1a-0410-9941-cceddc491573
* Fix .des timer messaging to be easier to customise, applied timer to sewer ↵dshaligram2008-12-011-2/+2
| | | | | | | | | | portals. Fix typo in monspeak.txt (slinkies). Fixed hippogriff plural. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7709 c06c8d41-db1a-0410-9941-cceddc491573
* Show place as "Sewer" in the HUD and in character dumps for the sewer portal ↵dshaligram2008-11-181-1/+7
| | | | | | vaults (portal vault entry marker's dst field is used as the name). Portal vault entrance is replaced with stone arch on use. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7474 c06c8d41-db1a-0410-9941-cceddc491573
* Remove pre-Stone Soup change history from source files, and push it allj-p-e-g2008-09-141-5/+0
| | | | | | | | | | into a file crawlhistory.txt in docs/obsolete. I used a perl script to do this under the assumption that all these change logs used the same system following the keyword "Change History". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6930 c06c8d41-db1a-0410-9941-cceddc491573
* Implemented monster spell miscasts. Spell miscasting is now handledzelgadis2008-07-291-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | by the MiscastEffect class, which has helper methods to make most of the non-helper code agnostic with respect to whether the miscaster is the player or a monster. Mummy death curses now affect monsters, and Zot traps now directly affect friendly and good-neutral monsters. In wizard mode you can force the player or a monster to miscast by targeting it and pressing 'M'. Todo/issues/notes: * Clouds now have a killer_type in addition to a kill_category. * There aren't any divination monster miscast effects yet. * Many of the harmless message-only miscast effects are missing monster messages. * If a monster actually miscasts a spell (not getting a mummy death curse or setting off a Zot trap) and this kills both the monster and the player then the wrong monster will be listed in hiscore entry. Since monsters can't do true spell miscasts yet, this can wait. * There was old, non-functioning code making Zot traps heal, haste or turn invisible hostile monsters that triggered it. I fixed it and then commented it out. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6723 c06c8d41-db1a-0410-9941-cceddc491573
* Applying r6696 back to trunk (PCRE support).ennewalker2008-07-271-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6698 c06c8d41-db1a-0410-9941-cceddc491573
* Large tiles-related changes. Platform-specific rendering removed and ↵ennewalker2008-07-151-0/+3
| | | | | | replaced with SDL/OpenGL. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6550 c06c8d41-db1a-0410-9941-cceddc491573
* Fixing release-related issues. libpcre wasn't being linked statically for ↵ennewalker2008-07-121-1/+1
| | | | | | Win32 tiles builds. Neither Win32 build was copying the doc during a 'make install'. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6509 c06c8d41-db1a-0410-9941-cceddc491573
* Go back to consistently pluralizing "dwarf" as "dwarves".dolorous2008-07-111-2/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6496 c06c8d41-db1a-0410-9941-cceddc491573
* Misc. minor cleanups. (Yes, a huge amount of them but still...)j-p-e-g2008-06-261-4/+6
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6146 c06c8d41-db1a-0410-9941-cceddc491573
* The indefinite article for any string starting with "one-way" is "a",zelgadis2008-06-241-0/+3
| | | | | | | not "an". A hack, but then so is the English language. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6109 c06c8d41-db1a-0410-9941-cceddc491573
* Pluralize words ending in "folk" (e.g. "merfolk") by leaving them alone dolorous2008-06-051-1/+1
| | | | | | | instead of adding "s". git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5481 c06c8d41-db1a-0410-9941-cceddc491573
* Comment fixes.dolorous2008-06-051-3/+3
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5480 c06c8d41-db1a-0410-9941-cceddc491573
* Move the mpr version of the monster list to output.cc and add it toj-p-e-g2008-05-241-30/+31
| | | | | | | | | | | | | | | | | the dumped information in the morgue. Change monster naming to the precise listing of zombie sub types etc. but list monster types in brackets for non-unique named monsters, so you can now find information like the following in your morgue file: "You can see a goblin, an orc, two orc warriors, thirteen friendly orcs, and the friendly Bogrim (orc priest)." Since the concise version of the monster list is still an in-game command ('F'), this also neatly solves the problem of orc players not knowing the type of their followers. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5223 c06c8d41-db1a-0410-9941-cceddc491573
* Fixes to compile with Visual C++. Moved direct.cc and direct.h to directn.* ↵dshaligram2008-04-191-2/+2
| | | | | | to avoid conflict with VC++ direct.h header. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4390 c06c8d41-db1a-0410-9941-cceddc491573
* Yet Another Code Cleanup, this time concentrating on libx11.cc and j-p-e-g2008-04-011-43/+77
| | | | | | | view.cc. (Yes, this is semi-random.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4032 c06c8d41-db1a-0410-9941-cceddc491573
* Monster list fixes:ennewalker2008-03-241-0/+11
| | | | | | | | | | * get_visible_monsters() now just silently returns descriptions * _mpr_monsters() now handles all printing of information * monster list is now written to a separate monster region (GOTO_MLIST) * added asserts to libutil that will catch behavior that breaks tile version * turned off monster list for tile version (until implemented) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3851 c06c8d41-db1a-0410-9941-cceddc491573
* [1914525] Fixed pluralisation of branded missiles in the quiver.dshaligram2008-03-151-0/+4
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3659 c06c8d41-db1a-0410-9941-cceddc491573
* Fix some link errors and a few remaining compile warnings (thepauldubois2008-03-101-0/+2
| | | | | | | | | | | | | ones that aren't bugs) - if static const int foo=VALUE; is in header, don't need to have a definition in a .cc file. The definition goes into every .cc file with "vague linkage" - add sqlite and lua to the sln/vcproj git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3576 c06c8d41-db1a-0410-9941-cceddc491573
* Another batch of msvc compile fixes.pauldubois2008-03-101-1/+1
| | | | | | | | | | | | | | Added wrapper implementation for opendir/readdir Other functions left stubbed out. It's a shame that crawl's "direct.h" conflicts with <direct.h>. Fixed up use of AppHdr.h in a couple places (it must be included first); changed project to use precompiled headers. crawl now compiles cleanly but doesn't link. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3573 c06c8d41-db1a-0410-9941-cceddc491573
* bug 1895003; add ';' to shell_safepauldubois2008-03-021-1/+1
| | | | git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3502 c06c8d41-db1a-0410-9941-cceddc491573