X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=io.c;h=309069318356ed571d6bd5f7c8f31280b9ba6590;hb=fee8e83e1b2c4d61bd0346d282dd89074580140b;hp=3bc3b9c2c88d225069e90723e3ba96093f871dd8;hpb=5fd1629b862b1a1bba3f70d4d06ba0b0859ec0e6;p=super-star-trek.git diff --git a/io.c b/io.c index 3bc3b9c..3090693 100644 --- a/io.c +++ b/io.c @@ -81,23 +81,11 @@ 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 + getche(); +#endif /* SERGEEV */ } void pause_game(int i) { @@ -133,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; } @@ -304,6 +295,22 @@ void warble(void) #endif /* SERGEEV */ } +void setpassword(void) { +#ifndef SERGEEV + while (TRUE) { + scan(); + strcpy(game.passwd, citem); + chew(); + if (*game.passwd != 0) break; + proutn("Please type in a secret password-"); + } +#else + int i; + for(i=0;i<3;i++) game.passwd[i]=(char)(97+(int)(Rand()*25)); + game.passwd[3]=0; +#endif /* SERGEEV */ +} + void getline(char *line, int max) { if (curses) { #ifndef SERGEEV