setwnd() is now a save no-op in TTY mode.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 4 Feb 2005 03:32:10 +0000 (03:32 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 4 Feb 2005 03:32:10 +0000 (03:32 +0000)
conio.c
io.c
sst.c

diff --git a/conio.c b/conio.c
index 95e8a78c81085bdd1f1aa5483e352c719915e0a6..1aca05ebe0b2cb2bd9bf553e20b911a19cd01161 100644 (file)
--- 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 91d938720346faba5942380b9a30460d86adec8a..c432078371539721b1a64162b940ed191ff4505a 100644 (file)
--- a/io.c
+++ b/io.c
@@ -6,6 +6,7 @@
 #include <signal.h>
 #include <ctype.h>
 #include <stdarg.h>
+#include <time.h>
 
 #include "conio.h"
 #include "sstlinux.h"
diff --git a/sst.c b/sst.c
index 72aeedfa662aa1520f4e7ac77628ba46504b32be..f6b86b1cedb6f876bb9d92e3747696183214e206 100644 (file)
--- 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