A step towards validation.
[super-star-trek.git] / conio.c
diff --git a/conio.c b/conio.c
index 92598140141e2e12633872e123c3c08ab8fa2965..27c38c3842786bcbe93d2aeb9134a649e4fc9bc4 100644 (file)
--- a/conio.c
+++ b/conio.c
@@ -31,6 +31,7 @@ char color_warning=1;
 int directvideo;
 WINDOW *conio_scr;
 
+#ifdef SERGEEV 
 /* Some internals... */
 static int colortab(int a) /* convert LINUX Color code to DOS-standard */
 {
@@ -46,6 +47,7 @@ static int colortab(int a) /* convert LINUX Color code to DOS-standard */
    }
    return COLOR_BLACK;
 } 
+#endif /* SERGEEV */
 
 static void docolor (int color) /* Set DOS-like text mode colors */
 {
@@ -122,16 +124,22 @@ char *cgets (char *str) /* ugly function :-( */
 }
 
 void clreol (void)
+/* clear to end of line -- can be a no-op in tty mode */
 {
+#ifdef SERGEEV
    wclrtoeol(conio_scr);
    wrefresh(conio_scr);
+#endif /* SERGEEV */
 }
 
 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, ... )
@@ -142,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);
 }
 
@@ -213,17 +226,22 @@ void gettextinfo(struct text_info *inforec)
 } 
 
 void gotoxy (int x, int y)
+/* address cursor -- OK for this to be a no-op in TTY mode */
 {
+#ifdef SERGEEV
    y--;
    x--;
    wmove(conio_scr,y,x);
    wrefresh(conio_scr);
+#endif /* SERGEEV */
 }
 
 void highvideo (void)
 {
+#ifdef SERGEEV
    textcolor(15); /* White */
    textbackground(0); /* Black */
+#endif /* SERGEEV */
 }
 
 void insline (void)
@@ -274,11 +292,14 @@ void textbackground (int color)
    docolor(color);
 }
 
+
 void textcolor (int color)
 {
+#ifdef SERGEEV
    fgc=color;
    color=(bgc*16)+fgc;
    docolor(color);
+#endif /* SERGEEV */
 }
  
 void textmode (int mode)