-#endif /* SERGEEV */
-void prouts(char *fmt, ...) {
-#ifndef SERGEEV
- clock_t endTime;
- char *s, buf[BUFSIZ];
- /* print slowly! */
- va_list ap;
- va_start(ap, fmt);
- vsprintf(buf, fmt, ap);
- va_end(ap);
- skip(1);
- for (s = buf; *s; s++) {
- endTime = clock() + CLOCKS_PER_SEC*0.05;
- while (clock() < endTime) continue;
- if (curses) {
- waddch(stdscr, *s);
- wrefresh(stdscr);
- }
- else {
- putchar(*s);
- fflush(stdout);
- }
+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);
+ }
+}
+
+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;