diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-02-21 17:41:30 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-02-21 17:41:30 +0000 |
commit | 9fd12611e22411e75014d154ca4026a1fe726811 (patch) | |
tree | 4eb0818d6196d6ced343824b69d11cf95bea3ca2 /crawl-ref/source/libunix.cc | |
parent | 22ace1c2189a49f7ebce0d117bb9e41af36d7207 (diff) | |
download | crawl-ref-9fd12611e22411e75014d154ca4026a1fe726811.tar.gz crawl-ref-9fd12611e22411e75014d154ca4026a1fe726811.zip |
Fixed use_fake_cursor brokenness for DEC, fixed stringize_glyph mangling DEC if Crawl was built with Unicode support.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3452 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/libunix.cc')
-rw-r--r-- | crawl-ref/source/libunix.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crawl-ref/source/libunix.cc b/crawl-ref/source/libunix.cc index f5f59ea4d7..d90347dbf9 100644 --- a/crawl-ref/source/libunix.cc +++ b/crawl-ref/source/libunix.cc @@ -921,18 +921,19 @@ static void flip_colour(cchar_t &ch) } const int newpair = (fg * 8 + bg); - ch.attr = COLOR_PAIR(newpair); + ch.attr = COLOR_PAIR(newpair) | (ch.attr & A_ALTCHARSET); } #else // ! UNICODE_GLYPHS -typedef unsigned char_info; +typedef unsigned long char_info; #define character_at(y,x) mvinch(y,x) #define valid_char(x) (x) #define write_char_at(y,x,c) mvaddch(y, x, c) #define char_info_character(c) ((c) & A_CHARTEXT) #define char_info_colour(c) ((c) & A_COLOR) - -static void flip_colour(unsigned &ch) +#define char_info_attributes(c) ((c) & A_ATTRIBUTES) + +static void flip_colour(char_info &ch) { const unsigned colour = char_info_colour(ch); const int pair = PAIR_NUMBER(colour); @@ -947,7 +948,8 @@ static void flip_colour(unsigned &ch) } const int newpair = (fg * 8 + bg); - ch = ((ch & 127) | COLOR_PAIR(newpair)); + ch = (char_info_character(ch) | COLOR_PAIR(newpair) | + (char_info_attributes(ch) & A_ALTCHARSET)); } #endif |