projects
/
super-star-trek.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Hide a structure.
[super-star-trek.git]
/
conio.c
diff --git
a/conio.c
b/conio.c
index adf42e5e58adfd0de2aa8489ab3a20551210f7a3..9f51c31987f2ddd65d2ad7137a7a2bdc6bfdac87 100644
(file)
--- a/
conio.c
+++ b/
conio.c
@@
-60,7
+60,7
@@
static void docolor (int color) /* Set DOS-like text mode colors */
}
/* Call this before any call to linux conio - except the port functions ! */
}
/* 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 */
+void
initconio (void)
{
int x,y;
short pair;
{
int x,y;
short pair;
@@
-120,16
+120,22
@@
char *cgets (char *str) /* ugly function :-( */
}
void clreol (void)
}
void clreol (void)
+/* clear to end of line -- can be a no-op in tty mode */
{
{
+#ifdef SERGEEV
wclrtoeol(conio_scr);
wrefresh(conio_scr);
wclrtoeol(conio_scr);
wrefresh(conio_scr);
+#endif /* SERGEEV */
}
void clrscr (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);
wclear(conio_scr);
wmove(conio_scr,0,0);
wrefresh(conio_scr);
+#endif /* SERGEEV */
}
int cprintf (char *format, ... )
}
int cprintf (char *format, ... )
@@
-140,8
+146,13
@@
int cprintf (char *format, ... )
va_start(argp,format);
vsprintf(buffer,format,argp);
va_end(argp);
va_start(argp,format);
vsprintf(buffer,format,argp);
va_end(argp);
+
+#ifdef SERGEEV
i=waddstr(conio_scr,buffer);
wrefresh(conio_scr);
i=waddstr(conio_scr,buffer);
wrefresh(conio_scr);
+#else
+ i=printf(buffer);
+#endif /* SERGEEV */
return(i);
}
return(i);
}
@@
-211,17
+222,22
@@
void gettextinfo(struct text_info *inforec)
}
void gotoxy (int x, int y)
}
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);
y--;
x--;
wmove(conio_scr,y,x);
wrefresh(conio_scr);
+#endif /* SERGEEV */
}
void highvideo (void)
{
}
void highvideo (void)
{
+#ifdef SERGEEV
textcolor(15); /* White */
textbackground(0); /* Black */
textcolor(15); /* White */
textbackground(0); /* Black */
+#endif /* SERGEEV */
}
void insline (void)
}
void insline (void)
@@
-272,11
+288,14
@@
void textbackground (int color)
docolor(color);
}
docolor(color);
}
+
void textcolor (int color)
{
void textcolor (int color)
{
+#ifdef SERGEEV
fgc=color;
color=(bgc*16)+fgc;
docolor(color);
fgc=color;
color=(bgc*16)+fgc;
docolor(color);
+#endif /* SERGEEV */
}
void textmode (int mode)
}
void textmode (int mode)