From 74aa3e84dfceb030221c66de9b6ecb572ba7cdd9 Mon Sep 17 00:00:00 2001 From: John Zaitseff Date: Tue, 30 Aug 2011 09:15:15 +1000 Subject: [PATCH] Fix a couple of display bugs Firstly, Ncurses addchstr() and family do not work, it seems, with multibyte strings, so use addch() instead. Secondly, PRINTABLE_MAP_VAL returns a wchar_t wide character, not a byte-sized char. --- src/exch.c | 5 ++--- src/move.c | 8 ++++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/exch.c b/src/exch.c index 3d4d43b..da88c29 100644 --- a/src/exch.c +++ b/src/exch.c @@ -152,9 +152,8 @@ void exchange_stock (void) for (line = 6, i = 0; i < MAX_COMPANIES; i++) { if (company[i].on_map) { - mvwaddch(curwin, line, 2, PRINTABLE_MAP_VAL(COMPANY_TO_MAP(i)) - | attr_choice); - + left(curwin, line, 2, attr_choice, 0, 0, 1, "%lc", + (wint_t) PRINTABLE_MAP_VAL(COMPANY_TO_MAP(i))); left(curwin, line, 4, attr_normal, 0, 0, 1, "%ls", company[i].name); diff --git a/src/move.c b/src/move.c index 03c819e..40f4dd8 100644 --- a/src/move.c +++ b/src/move.c @@ -219,8 +219,12 @@ selection_t get_move (void) // Display current move choices on the galaxy map for (int i = 0; i < NUMBER_MOVES; i++) { - mvwaddchstr(curwin, game_move[i].y + 3, game_move[i].x * 2 + 2, - CHTYPE_GAME_MOVE(i)); + chtype *movestr = CHTYPE_GAME_MOVE(i); + + wmove(curwin, game_move[i].y + 3, game_move[i].x * 2 + 2); + while (*movestr != 0) { + waddch(curwin, *movestr++); + } } wrefresh(curwin);