From 804b7341fab3c3482593546c74c19189b9267333 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Fri, 2 Apr 2004 07:10:16 +0000 Subject: [PATCH] Added textcolor(), textbackground(), clreol(), and putch() for better conio compatability. --- src/uifc/ciowrap.c | 20 ++++++++++++++++++++ src/uifc/ciowrap.h | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/src/uifc/ciowrap.c b/src/uifc/ciowrap.c index 6d614f3956..4769eac272 100644 --- a/src/uifc/ciowrap.c +++ b/src/uifc/ciowrap.c @@ -331,6 +331,26 @@ void textattr(unsigned char attr) bkgdset(colour); } +void textbackground(int colour) +{ + unsigned char attr; + + attr=lastattr; + attr&=143; + attr|=(colour<<4); + textattr(attr); +} + +void textcolor(int colour) +{ + unsigned char attr; + + attr=lastattr; + attr&=240; + attr|=colour; + textattr(attr); +} + int kbhit(void) { struct timeval timeout; diff --git a/src/uifc/ciowrap.h b/src/uifc/ciowrap.h index 10685f86fb..5b928eac59 100644 --- a/src/uifc/ciowrap.h +++ b/src/uifc/ciowrap.h @@ -48,6 +48,8 @@ struct text_info { unsigned char screenwidth; }; +#define clreol() clrtoeol() +#define putch(x) echochar(x) short curses_color(short color); int puttext(int sx, int sy, int ex, int ey, unsigned char *fill); #define gettext(x1,y1,x2,y2,z) cio_gettext(x1,y1,x2,y2,z) @@ -67,3 +69,5 @@ void clrscr(void); void initciowrap(long inmode); void gettextinfo(struct text_info *info); void _setcursortype(int type); +void textbackground(int colour); +void textcolor(int colour); -- GitLab