X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=conio.c;h=27c38c3842786bcbe93d2aeb9134a649e4fc9bc4;hb=226428aac31ae604029f55c3c2fb7fff59e10009;hp=9c37ad5225c654155d7474ad6a1ea2ff3f0e56d5;hpb=49483a1747cd310e33eea758b32a453fb46d4aac;p=super-star-trek.git diff --git a/conio.c b/conio.c index 9c37ad5..27c38c3 100644 --- a/conio.c +++ b/conio.c @@ -124,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, ... ) @@ -144,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); } @@ -215,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) @@ -276,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)