summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/format.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!
* Also display mismatched closing colour tags.Neil Moore2014-03-071-2/+5
|
* Display extra closing colour tags rather than crashing.Neil Moore2014-03-071-3/+8
| | | | | | | | | The crash was trivially triggerable by any user by calling crawl.mpr("</red>") from Lua. It could also trigger, for example, when printing an error message about Lua code that itself contains a colour tag. Now display the unbalanced tag in lightred so it stands out.
* 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.
* Fix escaped < not being unescaped if it is on line end.Raphael Langella2013-12-051-1/+1
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-1/+1
|
* Axe a buttload of useless #includes.Adam Borowski2013-11-031-1/+0
| | | | | Can't test Android, MSVC or Mac, but a very brief glance at the diff suggests it's unlikely they're affected.
* Drop a lot of unnecessary braces.Adam Borowski2012-10-241-2/+0
| | | | | The perl one-liner I use for this had a bug where it didn't match "else" at the end of a line (ie, most of the time).
* Rename struct glyph to cglyph_t.Adam Borowski2012-10-161-1/+1
| | | | Hard to come up with something less greppable...
* Add spelling fixes.David Lawrence Ramsey2012-10-121-1/+1
|
* Use std namespace.Raphael Langella2012-08-261-51/+47
| | | | | | | | | | | | | 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.
* Drop a bunch of parentheses from return statements.Adam Borowski2012-08-081-1/+1
| | | | | This is incomplete, partially because of me getting bored, partially because of doubts about the point of leaving simple addition/etc in parentheses.
* Some more return deparenthesization.Adam Borowski2012-07-051-2/+2
|
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-6/+6
|
* Drop pointless braces after else/else if as well.Adam Borowski2012-04-201-6/+0
|
* Rename translate.cc to lang-fake.cc, to avoid confusion.Adam Borowski2012-04-021-3/+3
| | | | I intend to name actual per-language C++ files lang-en.cc, lang-pl.cc
* New translations: dwarven, jägerkin, lithp, german.Adam Borowski2012-03-301-0/+8
|
* Make another bunch of functions static or deleted.Adam Borowski2012-03-211-7/+7
| | | | | Looks like get_XXX_path and the like in files.cc could use some drastic simplification, or perhaps even a nuking and rewrite.
* Consistently use a space after flow control statements.Adam Borowski2011-12-021-1/+1
|
* Merge branch 'master' into unified_combat_controlRobert Burnham2011-10-251-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: crawl-ref/source/Makefile.obj crawl-ref/source/dbg-scan.cc crawl-ref/source/decks.cc crawl-ref/source/describe.cc crawl-ref/source/directn.cc crawl-ref/source/evoke.cc crawl-ref/source/fight.cc crawl-ref/source/fight.h crawl-ref/source/ghost.cc crawl-ref/source/ghost.h crawl-ref/source/item_use.cc crawl-ref/source/items.cc crawl-ref/source/map_knowledge.cc crawl-ref/source/melee_attack.h crawl-ref/source/mon-abil.cc crawl-ref/source/mon-act.cc crawl-ref/source/mon-stuff.cc crawl-ref/source/monster.cc crawl-ref/source/monster.h crawl-ref/source/player.cc crawl-ref/source/player.h crawl-ref/source/shopping.cc crawl-ref/source/spl-damage.cc crawl-ref/source/spl-summoning.cc crawl-ref/source/spl-transloc.cc crawl-ref/source/stairs.cc crawl-ref/source/stuff.cc crawl-ref/source/tags.cc crawl-ref/source/traps.cc crawl-ref/source/xom.cc
| * Combine common parts of lib*.hAdam Borowski2011-09-081-1/+1
| | | | | | | | | | 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.
* | Merge branch 'master' into unified_combat_controlRobert Burnham2011-04-261-97/+35
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: crawl-ref/source/actor.cc crawl-ref/source/delay.cc crawl-ref/source/directn.cc crawl-ref/source/directn.h crawl-ref/source/fight.cc crawl-ref/source/files.cc crawl-ref/source/mon-act.cc crawl-ref/source/monster.cc crawl-ref/source/mpr.h crawl-ref/source/player.cc crawl-ref/source/shopping.cc
| * Fix and merge away tagged_string_substr().Adam Borowski2011-04-041-50/+0
| | | | | | | | | | It was used on user-supplied string (inscribed items), so non-ASCII can happen in 0.8.
| * formatted_string fixes.Adam Borowski2011-04-041-39/+30
| | | | | | | | Used by, among others, message history, so user-supplied strings can happen.
| * Doxygenization and junk purging that was missed by my script.Adam Borowski2011-04-021-5/+0
| |
| * Make a function static.Adam Borowski2011-04-011-2/+2
| | | | | | | | | | tagged_string_tag_length() is used just once, too -- duplicating code that's done in different ways elsewhere. A candidate for clean-up.
| * Fix compilation on 64 bit.Adam Borowski2011-03-211-1/+1
| |
| * Fix #1184: Limit tagged block display's lines to screen size.Johanna Ploog2011-03-201-1/+3
| | | | | | | | | | | | | | Puts a stop-gap measure to the frequent assertions for Elyvilonists. The text still needs shortening, as it's simply cut off when the last line is reached (which is then overwritten with the ! toggle explanation, anyway).
* | Capitalized mprf().Adam Borowski2011-04-151-0/+10
|/ | | | | It's going to be the default for mprf() since 99% uses are capitalized, but it's safer to do this piecemeal then sed it back.
* Mention the failed string in formatted string asserts.Adam Borowski2011-01-181-1/+1
|
* Give all ASSERT(false) proper messages.Adam Borowski2011-01-111-4/+1
|
* Convert ASSERT(!"foo") to die("foo").Adam Borowski2011-01-111-3/+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.
* An otherwise inappropiate toy for Sprint.Adam Borowski2010-07-081-0/+7
| | | | | | | | * single-use only * causes corona-like glow * makes all messages ALL CAPS * does what it says on the tin to all damage you deal * cause gibs if it brings someone to less than -50hp
* For functions with names starting with _, actually declare them static.Adam Borowski2010-07-061-1/+1
|
* Don't cgotoxy a line too far down (#1591, #1604).Robert Vollmert2010-05-291-3/+4
|
* Remove EOL.Robert Vollmert2010-03-111-5/+5
| | | | | | | | | | | We were only setting it to "\r\n" on DOS, but according to commens in #1045, DOS will translate "\n" to "\r\n" automatically for text output. Also, the DOS EOL handling was likely broken anyway looking at how a lot of the linebreaking code only considered "\n". Fixes issue #1045.
* Remove FSOP_CURSOR and formatted_string::cgotoxy.Robert Vollmert2010-03-111-32/+1
| | | | | | | | It's not used anymore, and a lot of code doesn't even deal with it properly. Also fix what seemed to be a bug in FSOP_COLOUR handling in formatted_string::substr.
* Remove obsolete formatted_string::movexy.Robert Vollmert2010-03-111-5/+0
|
* Replace formatted_string::parse_block by display_tagged_block.Robert Vollmert2010-03-111-35/+9
| | | | | | | | The latter invokes parse_string_to_multiple and displays directly. This fixes line wrapping issues with full lines: on an 80 column terminal, an 80 character line could cause the cursor to wrap to the next line, causing extra blank lines due to the manual line feed in formatted_string::parse_block.
* Nuke a whole lot of old-style casts, and remove some casts completelyHaran Pilpel2010-01-291-1/+3
| | | | | (you don't need to cast an X* to a void* and you don't need to cast arguments to math.h functions such as sqrt.)
* Add formatted_string::empty().Robert Vollmert2010-01-251-0/+5
|
* Remove libutil.h from AppHdr.h and include explicitly.Robert Vollmert2010-01-201-0/+1
| | | | | | | Also extract unwind_var template to unwind.h. The latter is now included from AppHdr.h, though it needn't really be. This means it's now possible to use coord_def in libutil.h.
* Fix bad varargs handling.Robert Vollmert2009-12-171-1/+1
| | | | You can't pass a va_list to a variadic function.
* Replace static snprintf() with make_sprintf() where the result is ↵Adam Borowski2009-12-171-4/+1
| | | | | | immediately cast to std::string.
* Add general formatted_string::add_glyph, remove others.Robert Vollmert2009-12-011-11/+1
|
* Convert get_mons_glyph to return a glyph struct.Robert Vollmert2009-11-151-5/+3
|
* Convert get_item_glyph to return a glyph struct.Robert Vollmert2009-11-151-5/+3
| | | | Also don't use get_symbol.
* Remove a few obsolete includes.Robert Vollmert2009-11-101-1/+0
| | | | Also add a few previously indirect includes.