#define CH_LOWER_HALF_BLOCK '_' /* 0xdc */
#define CH_LEFT_HALF_BLOCK '[' /* 0xdd */
#define CH_RIGHT_HALF_BLOCK ']' /* 0xde */
- #define CH_UPPER_HALF_BLOCK '=' /* 0xdf */
+ #define CH_UPPER_HALF_BLOCK '~' /* 0xdf */
#define CH_GREEK_SMALL_LETTER_ALPHA 'a' /* 0xe0 */
#define CH_LATIN_SMALL_LETTER_SHARP_S 'B' /* 0xe1 */
#define CH_GREEK_CAPITAL_LETTER_GAMMA 'F' /* 0xe2 */
#define CH_MAXIMUM 256
-#if !defined(CH_USE_CP437) && !defined(CH_USE_MULTIBYTE)
+#if !defined(CH_USE_CP437)
/* Translate CP437 extended characters into the code page used by the console */
inline int translateGraphicsChar(unsigned char c) { return gchar[c]; }
#else // CH_USE_CP437
/* prints a long blurb showing how to page forward and back */
void addpagestr();
/* Variants of addch and mvaddch that work on chars and use translateGraphicsChar(), fixing display of extended characters */
+#if defined(CH_USE_MULTIBYTE)
+inline int addchar(char ch) { return addch(ch); }
+inline int mvaddchar(int y,int x,char ch) { return mvaddch(y,x,ch); }
+inline int addgrah(char ch) { return addch(translateGraphicsChar(ch)); }
+inline int mvaddgrah(int y,int x,char ch) { return mvaddch(y,x,translateGraphicsChar(ch)); }
+#else
inline int addchar(char ch) { return addch(translateGraphicsChar(ch)); }
inline int mvaddchar(int y,int x,char ch) { return mvaddch(y,x,translateGraphicsChar(ch)); }
+inline int addgrah(char ch) { return addch(translateGraphicsChar(ch)); }
+inline int mvaddgrah(int y,int x,char ch) { return mvaddch(y,x,translateGraphicsChar(ch)); }
+#endif
inline int addchar(char ch,Log &log) { log.record(ch); return addchar(ch); }
inline int mvaddchar(int y,int x,char ch,Log &log) { log.record(ch); return mvaddchar(y,x,ch); }
/* Redefining addstr() and mvaddstr() so they use addchar() and mvaddchar(), fixing display of extended characters */
#undef addstr
+#if !defined(CH_USE_MULTIBYTE)
inline int addstr(const char* text) { int ret=ERR; for(int i=0;i<len(text);i++) ret=addchar(text[i]); return ret; }
+#endif
+#if !defined(CH_USE_MULTIBYTE)
#undef mvaddstr
inline int mvaddstr(int y,int x,const char* text) { int ret=move(y,x); if(ret!=ERR) ret=addstr(text); return ret; }
+#endif
/* Various wrappers to addstr() and mvaddstr() which handle permutations of:
- Including or not including the gamelog for external message logging
- std::string or c-style char arrays */
inline int addstr(const char *text,Log &log) { log.record(text); return addstr(text); }
inline int mvaddstr(int y,int x,const char *text,Log &log) { log.record(text); return mvaddstr(y,x,text); }
+#if defined(CH_USE_MULTIBYTE)
+inline int addstr(const std::string& text) { return addstr(&text[0]); }
+#else
inline int addstr(const std::string& text) { int ret=ERR; for(int i=0;i<len(text);i++) ret=addchar(text[i]); return ret; }
+#endif
inline int addstr(const std::string& text, Log &log) { log.record(text); return addstr(text); }
inline int mvaddstr(int y,int x,const std::string& text) { int ret=move(y,x); if(ret!=ERR) ret=addstr(text); return ret; }
inline int mvaddstr(int y,int x,const std::string& text,Log &log) { log.record(text); return mvaddstr(y,x,text); }
set_color(translateGraphicsColor(newstops[5][x][y][1]),
translateGraphicsColor(newstops[5][x][y][2]),
newstops[5][x][y][3]);
- addchar(newstops[5][x][y][0]);
+ addgrah(newstops[5][x][y][0]);
}
else
{
set_color(translateGraphicsColor(newstops[pap][x][y][1]),
translateGraphicsColor(newstops[pap][x][y][2]),
newstops[pap][x][y][3]);
- addchar(newstops[pap][x][y][0]);
+ addgrah(newstops[pap][x][y][0]);
}
}
}
set_color(translateGraphicsColor(bigletters[p][x2][y2][1]),
translateGraphicsColor(bigletters[p][x2][y2][2]),
bigletters[p][x2][y2][3]);
- addchar(bigletters[p][x2][y2][0]);
+ addgrah(bigletters[p][x2][y2][0]);
}
}
x+=lim;
set_color(translateGraphicsColor(newspic[p][x2][y2][1]),
translateGraphicsColor(newspic[p][x2][y2][2]),
newspic[p][x2][y2][3]);
- addchar(newspic[p][x2][y2][0]);
+ addgrah(newspic[p][x2][y2][0]);
}
}