From 0adbc2a776c36b736bb5acb7184ba559d9428bc4 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Fri, 26 Jul 2019 22:13:33 +0100 Subject: towards dynamic screen management --- gramscii.c | 67 +++++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 23 deletions(-) (limited to 'gramscii.c') diff --git a/gramscii.c b/gramscii.c index 3bed08b..8a89fc9 100644 --- a/gramscii.c +++ b/gramscii.c @@ -33,6 +33,13 @@ #include "arg.h" +typedef struct{ + int sz; + int lst; + char *s; +} line_t; + + #define MOVE 0x00 #define BOX 0x01 #define ARROW 0x02 @@ -71,9 +78,10 @@ #define MIN(x,y) (x) < (y) ? (x) : (y) #define MAX(x,y) (x) > (y) ? (x) : (y) -/** #define DEBUG 1 **/ +#define DEBUG 1 -char **screen; +line_t *screen; +int num_lines; int WIDTH, HEIGHT; int state; @@ -113,7 +121,7 @@ struct termios t1, t2, t3; void dump_lines(){ int i; for (i=0; i