X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=conio.c;h=95e8a78c81085bdd1f1aa5483e352c719915e0a6;hb=a96a31750d67dfc0d4636aae4040155f78d5eda8;hp=adf42e5e58adfd0de2aa8489ab3a20551210f7a3;hpb=cf91699c89b88f76dcf63c60624635184e8cb7eb;p=super-star-trek.git diff --git a/conio.c b/conio.c index adf42e5..95e8a78 100644 --- 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 */ { @@ -59,6 +61,7 @@ static void docolor (int color) /* Set DOS-like text mode colors */ wattron(conio_scr,COLOR_PAIR(1+(color&7)+((color&112)>>1))); } +#ifdef SERGEEV /* Call this before any call to linux conio - except the port functions ! */ void __attribute__((constructor)) initconio (void) /* This is needed, because ncurses needs to be initialized */ { @@ -90,6 +93,7 @@ void __attribute__((constructor)) initconio (void) /* This is needed, because nc textcolor(7); textbackground(0); } +#endif /* SERGEEV */ /* Call this on exiting your program */ void doneconio (void) @@ -120,9 +124,12 @@ 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) @@ -211,17 +218,22 @@ void gettextinfo(struct text_info *inforec) } void gotoxy (int x, int y) +/* address cusor -- 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) @@ -272,11 +284,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)