+void setwnd(WINDOW *wnd)
+/* change windows -- OK for this to be a no-op in tty mode */
+{
+ if (game.options & OPTION_CURSES) {
+ curwnd=wnd;
+ curs_set(wnd == fullscreen_window || wnd == message_window || wnd == prompt_window);
+ }
+}
+
+void clreol (void)
+/* clear to end of line -- can be a no-op in tty mode */
+{
+ if (game.options & OPTION_CURSES) {
+ wclrtoeol(curwnd);
+ wrefresh(curwnd);
+ }
+}
+
+void clrscr (void)
+/* clear screen -- can be a no-op in tty mode */
+{
+ if (game.options & OPTION_CURSES) {
+ wclear(curwnd);
+ wmove(curwnd,0,0);
+ wrefresh(curwnd);
+ }
+ linecount = 0;
+}
+
+void textcolor (int color)
+{
+#ifdef A_COLOR
+ if (game.options & OPTION_CURSES) {
+ switch(color) {
+ case DEFAULT:
+ wattrset(curwnd, 0);
+ break;
+ case BLACK:
+ wattron(curwnd, COLOR_PAIR(COLOR_BLACK));
+ break;
+ case BLUE:
+ wattron(curwnd, COLOR_PAIR(COLOR_BLUE));
+ break;
+ case GREEN:
+ wattron(curwnd, COLOR_PAIR(COLOR_GREEN));
+ break;
+ case CYAN:
+ wattron(curwnd, COLOR_PAIR(COLOR_CYAN));
+ break;
+ case RED:
+ wattron(curwnd, COLOR_PAIR(COLOR_RED));
+ break;
+ case MAGENTA:
+ wattron(curwnd, COLOR_PAIR(COLOR_MAGENTA));
+ break;
+ case BROWN:
+ wattron(curwnd, COLOR_PAIR(COLOR_YELLOW));
+ break;
+ case LIGHTGRAY:
+ wattron(curwnd, COLOR_PAIR(COLOR_WHITE));
+ break;
+ case DARKGRAY:
+ wattron(curwnd, COLOR_PAIR(COLOR_BLACK) | A_BOLD);
+ break;
+ case LIGHTBLUE:
+ wattron(curwnd, COLOR_PAIR(COLOR_BLUE) | A_BOLD);
+ break;
+ case LIGHTGREEN:
+ wattron(curwnd, COLOR_PAIR(COLOR_GREEN) | A_BOLD);
+ break;
+ case LIGHTCYAN:
+ wattron(curwnd, COLOR_PAIR(COLOR_CYAN) | A_BOLD);
+ break;
+ case LIGHTRED:
+ wattron(curwnd, COLOR_PAIR(COLOR_RED) | A_BOLD);
+ break;
+ case LIGHTMAGENTA:
+ wattron(curwnd, COLOR_PAIR(COLOR_MAGENTA) | A_BOLD);
+ break;
+ case YELLOW:
+ wattron(curwnd, COLOR_PAIR(COLOR_YELLOW) | A_BOLD);
+ break;
+ case WHITE:
+ wattron(curwnd, COLOR_PAIR(COLOR_WHITE) | A_BOLD);
+ break;
+ }
+ }
+#endif /* A_COLOR */