summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/cio.cc2
-rw-r--r--crawl-ref/source/libunix.cc12
-rw-r--r--crawl-ref/source/view.cc4
3 files changed, 10 insertions, 8 deletions
diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc
index 526c4d07b2..8c506b2d53 100644
--- a/crawl-ref/source/cio.cc
+++ b/crawl-ref/source/cio.cc
@@ -173,7 +173,7 @@ void cursorxy(int x, int y)
{
#if defined(USE_TILE)
tile_place_cursor(x-1, y-1, true);
-#elif defined(UNIX) && !defined(USE_TILE)
+#elif defined(UNIX)
if (Options.use_fake_cursor)
fakecursorxy(x, y);
else
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
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index aba4e67a2b..617673ec7d 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -4252,10 +4252,10 @@ unsigned get_screen_glyph( int x, int y )
std::string stringize_glyph(unsigned glyph)
{
- if (crawl_state.glyph2strfn)
+ if (crawl_state.glyph2strfn && Options.char_set == CSET_UNICODE)
return (*crawl_state.glyph2strfn)(glyph);
- return std::string(1, glyph);
+ return (std::string(1, glyph));
}
int multibyte_strlen(const std::string &s)