Added ASCII emulation of BigNum to curses_drv.c

This commit is contained in:
reenoo
2001-11-28 21:11:51 +00:00
parent 6957956a14
commit 0286834079
+45 -5
View File
@@ -61,6 +61,49 @@ void curses_drv_restore_screen (void);
static char icon_char = '@';
static WINDOW *lcd_win;
/*this is really ugly ;) but works ;)*/
static char num_icon [10][4][3] = {{{' ','_',' '}, /*0*/
{'|',' ','|'},
{'|','_','|'},
{' ',' ',' '}},
{{' ',' ',' '},/*1*/
{' ',' ','|'},
{' ',' ','|'},
{' ',' ',' '}},
{{' ','_',' '},/*2*/
{' ','_','|'},
{'|','_',' '},
{' ',' ',' '}},
{{' ','_',' '},/*3*/
{' ','_','|'},
{' ','_','|'},
{' ',' ',' '}},
{{' ',' ',' '},/*4*/
{'|','_','|'},
{' ',' ','|'},
{' ',' ',' '}},
{{' ','_',' '},/*5*/
{'|','_',' '},
{' ','_','|'},
{' ',' ',' '}},
{{' ','_',' '},/*6*/
{'|','_',' '},
{'|','_','|'},
{' ',' ',' '}},
{{' ','_',' '},/*7*/
{' ',' ','|'},
{' ',' ','|'},
{' ',' ',' '}},
{{' ','_',' '},/*8*/
{'|','_','|'},
{'|','_','|'},
{' ',' ',' '}},
{{' ','_',' '},/*9*/
{'|','_','|'},
{' ','_','|'},
{' ',' ',' '}}};
/*end of ugly code ;) Rene Wagner*/
chtype get_color (char *colorstr) {
if (strcasecmp(colorstr, "red") == 0)
return COLOR_RED;
@@ -451,15 +494,12 @@ curses_drv_init_num ()
void
curses_drv_num (int x, int num)
{
char c;
int y, dx;
c = '0' + num;
// printf(&c,"%1d",num);
for (y = 1; y < 5; y++)
for (dx = 0; dx < 3; dx++)
curses_drv_chr (x + dx, y, c);
curses_drv_chr (x + dx, y, num_icon[num][y-1][dx]);
// printf("%1d",num);
}
/////////////////////////////////////////////////////////////////