X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=io.c;h=bce39c2c8c7f010ac06c73f3b6fd987ca6b6316c;hb=a96a31750d67dfc0d4636aae4040155f78d5eda8;hp=ec30ccffc676959c9c59bd9cfe7dacf4e58fdb17;hpb=059e1d86fb9ffc34d236e8913614996b3621b45c;p=super-star-trek.git diff --git a/io.c b/io.c index ec30ccf..bce39c2 100644 --- a/io.c +++ b/io.c @@ -81,25 +81,6 @@ void ioend(void) { outro(0); } -void clearscreen(void) { - /* Somehow we need to clear the screen */ -#ifdef __BORLANDC__ - extern void clrscr(void); - clrscr(); -#else - if (curses) { - wclear(stdscr); - wrefresh(stdscr); - } else { - // proutn("\033[2J"); /* Hope for an ANSI display */ - /* much more in that old-TTY spirit to just throw linefeeds */ - int i; - for (i = 0; i < screenheight; i++) - putchar('\n'); - } -#endif -} - void waitfor(void) { /* wait for user action -- OK to do nothing if on a TTY */ #ifdef SERGEEV @@ -140,7 +121,10 @@ void pause_game(int i) { proutn(prompt); fgets(buf, sizeof(buf), stdin); if (i != 0) { - clearscreen(); + /* much more in that old-TTY spirit to throw linefeeds */ + int j; + for (j = 0; j < screenheight; j++) + putchar('\n'); } linecount = 0; } @@ -293,6 +277,20 @@ void prouts(char *fmt, ...) { #endif /* SERGEEV */ } +void c_printf (char *format, ... ) +{ + char buffer[BUFSIZ]; /* Well, BUFSIZ is from ncurses... */ + va_list argp; + va_start(argp,format); + vsprintf(buffer,format,argp); + va_end(argp); +#ifdef SERGEEV + waddstr(conio_scr,buffer); +#else + proutn(buffer); +#endif /* SERGEEV */ +} + void warble(void) /* sound and visual effects for teleportation */ {