From: Eric S. Raymond Date: Fri, 4 Feb 2005 03:32:10 +0000 (+0000) Subject: setwnd() is now a save no-op in TTY mode. X-Git-Tag: 2.0~390 X-Git-Url: https://jxself.org/git/?p=super-star-trek.git;a=commitdiff_plain;h=a6127a240c143e22ec9acca5bf1dd61b66fa9638 setwnd() is now a save no-op in TTY mode. --- diff --git a/conio.c b/conio.c index 95e8a78..1aca05e 100644 --- a/conio.c +++ b/conio.c @@ -133,10 +133,13 @@ void clreol (void) } void clrscr (void) +/* clear screen -- can be a no-op in tty mode */ { +#ifdef SERGEEV wclear(conio_scr); wmove(conio_scr,0,0); wrefresh(conio_scr); +#endif /* SERGEEV */ } int cprintf (char *format, ... ) @@ -147,8 +150,13 @@ int cprintf (char *format, ... ) va_start(argp,format); vsprintf(buffer,format,argp); va_end(argp); + +#ifdef SERGEEV i=waddstr(conio_scr,buffer); wrefresh(conio_scr); +#else + i=printf(buffer); +#endif /* SERGEEV */ return(i); } diff --git a/io.c b/io.c index 91d9387..c432078 100644 --- a/io.c +++ b/io.c @@ -6,6 +6,7 @@ #include #include #include +#include #include "conio.h" #include "sstlinux.h" diff --git a/sst.c b/sst.c index 72aeedf..f6b86b1 100644 --- a/sst.c +++ b/sst.c @@ -199,15 +199,11 @@ static void helpme(void) { key = scan(); while (TRUE) { if (key == IHEOL) { -#ifdef SERGEEV setwnd(BOTTOM_WINDOW); -#endif /* SERGEEV */ proutn("Help on what command? "); key = scan(); } -#ifdef SERGEEV setwnd(LOWER_WINDOW); -#endif /* SERGEEV */ if (key == IHEOL) return; for (i = 0; i < NUMCOMMANDS; i++) { if (strcasecmp(commands[i].name, citem)==0) { @@ -292,10 +288,8 @@ void drawmaps(short l) { static void makemoves(void) { int i, hitme; -#ifdef SERGEEV clrscr(); setwnd(LOWER_WINDOW); -#endif /* SERGEEV */ while (TRUE) { /* command loop */ drawmaps(1); while (TRUE) { /* get a command */ @@ -304,10 +298,8 @@ static void makemoves(void) { Time = 0.0; i = -1; chew(); -#ifdef SERGEEV setwnd(BOTTOM_WINDOW); clrscr(); -#endif /* SERGEEV */ proutn("COMMAND> "); if (scan() == IHEOL) { #ifdef SERGEEV @@ -319,12 +311,10 @@ static void makemoves(void) { #endif /* SERGEEV */ continue; } -#ifdef SERGEEV ididit=0; clrscr(); setwnd(LOWER_WINDOW); clrscr(); -#endif /* SERGEEV */ for (i=0; i < ABANDON; i++) if (isit(commands[i].name)) { i = commands[i].value; @@ -444,9 +434,7 @@ static void makemoves(void) { break; case SAVE: // Save Game freeze(FALSE); -#ifdef SERGEEV clrscr(); -#endif /* SERGEEV */ if (skill > 3) prout("WARNING--Saved games produce no plaques!"); break; @@ -551,10 +539,8 @@ int main(int argc, char **argv) { } proutn("Do you want to play again? "); if (!ja()) break; -#ifdef SERGEEV setwnd(FULLSCREEN_WINDOW); clrscr(); -#endif /* SERGEEV */ } skip(1); #ifndef SERGEEV