diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-08 18:48:41 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-08 18:48:41 +0000 |
commit | 859a5ab42d2c9922f5ddc0b73961bb4231e379b7 (patch) | |
tree | 3fbd5e9d68ebe65470346bf7676ca92143452e21 /crawl-ref/source/message.cc | |
parent | e2b75cbb2ad69c4cfd62eca04a82ee3fa04e3d6b (diff) | |
download | crawl-ref-859a5ab42d2c9922f5ddc0b73961bb4231e379b7.tar.gz crawl-ref-859a5ab42d2c9922f5ddc0b73961bb4231e379b7.zip |
When showing glyphs in messages (as in the tutorial), use stringize_glyph() to
convert Unicode glyphs to multibyte sequences.
Added multibyte_strlen to calculate string lengths correctly when dealing with
multibyte strings.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1560 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/message.cc')
-rw-r--r-- | crawl-ref/source/message.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crawl-ref/source/message.cc b/crawl-ref/source/message.cc index be11e734db..3e92777930 100644 --- a/crawl-ref/source/message.cc +++ b/crawl-ref/source/message.cc @@ -556,7 +556,6 @@ static void mpr_formatted_output(formatted_string fs, int colour) need_prefix = false; } - for ( unsigned i = 0; i < fs.ops.size(); ++i ) { switch ( fs.ops[i].type ) @@ -567,7 +566,7 @@ static void mpr_formatted_output(formatted_string fs, int colour) case FSOP_TEXT: message_out(Message_Line, colour, fs.ops[i].text.c_str(), curcol, false); - curcol += fs.ops[i].text.length(); + curcol += multibyte_strlen(fs.ops[i].text); break; case FSOP_CURSOR: break; @@ -595,7 +594,7 @@ void formatted_mpr(const formatted_string& fs, int channel, int param) // output given string as formatted message, but check patterns // for string stripped of tags and store original tagged string // for message history -void formatted_message_history(const std::string st, int channel, int param) +void formatted_message_history(const std::string &st, int channel, int param) { if (suppress_messages) return; @@ -787,7 +786,7 @@ void replay_messages(void) textcolor( colour ); gotoxy(curcol, wherey()); cprintf(fs.ops[j].text.c_str()); - curcol += fs.ops[j].text.length(); + curcol += multibyte_strlen(fs.ops[j].text); break; case FSOP_CURSOR: break; |