From 5dd00eaf46bd250099c368c7b4a66e0e4dfc4b6f Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Thu, 18 Jul 2019 18:46:58 +0100 Subject: different line styles --- gramscii.c | 158 ++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 89 insertions(+), 69 deletions(-) (limited to 'gramscii.c') diff --git a/gramscii.c b/gramscii.c index 40d1f1e..bf988be 100644 --- a/gramscii.c +++ b/gramscii.c @@ -26,14 +26,12 @@ #define WIDTH 100 #define HEIGHT 25 +#define NOFIX 0x0 +#define FIX 0x1 + #define BG ' ' #define PTR '+' #define UND '_' -#define LINE_H '-' -#define LINE_V '|' -#define DBLINE_H '=' -#define DBLINE_V 'u' -#define BLDLINE '#' #define ARR_L '<' #define ARR_R '>' #define ARR_U '^' @@ -52,10 +50,15 @@ int y; int step; char cursor; char corner; -char box_line_h; -char box_line_v; -char arrow_line_h; -char arrow_line_v; +char hlines[] = {"-~=#@._"}; +char vlines[] = {"|H#@:;i"}; +char corners[] = {"+'H#@.\""}; +int hlines_sz= sizeof(hlines); +int vlines_sz= sizeof(vlines); +int corners_sz = sizeof(corners); +int cur_hl, cur_vl, cur_corn; +char line_h; +char line_v; struct termios t1, t2; @@ -69,8 +72,6 @@ void cleanup(int s){ void show_cursor(){ printf("\033[%d;%df", y+1, x+1); - //putchar(screen[y][x]); - //printf("\033[%d;%df", y+1, x+2); } void set(char c){ @@ -88,46 +89,46 @@ void draw_xy(int x, int y, char c){ putchar(c); } -void clear(){ - screen[y][x] = BG; -} - void init_screen(){ int i; for(i=0; i