summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-21 17:41:30 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-02-21 17:41:30 +0000
commit9fd12611e22411e75014d154ca4026a1fe726811 (patch)
tree4eb0818d6196d6ced343824b69d11cf95bea3ca2 /crawl-ref
parent22ace1c2189a49f7ebce0d117bb9e41af36d7207 (diff)
downloadcrawl-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')
-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)