mirror of https://github.com/fairyglade/ly.git
Add skeleton of matrix animation
This commit is contained in:
parent
bfb13b9c40
commit
14d53fdeed
29
src/draw.c
29
src/draw.c
|
|
@ -69,6 +69,7 @@ void draw_init(struct term_buf* buf)
|
|||
}
|
||||
|
||||
static void doom_free(struct term_buf* buf);
|
||||
static void matrix_free(struct term_buf* buf);
|
||||
|
||||
void draw_free(struct term_buf* buf)
|
||||
{
|
||||
|
|
@ -79,6 +80,9 @@ void draw_free(struct term_buf* buf)
|
|||
case 0:
|
||||
doom_free(buf);
|
||||
break;
|
||||
case 1:
|
||||
matrix_free(buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -513,6 +517,16 @@ static void doom_free(struct term_buf* buf)
|
|||
free(buf->astate.doom);
|
||||
}
|
||||
|
||||
static void matrix_init(struct term_buf* buf)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
static void matrix_free(struct term_buf* buf)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void animate_init(struct term_buf* buf)
|
||||
{
|
||||
if (config.animate)
|
||||
|
|
@ -524,6 +538,11 @@ void animate_init(struct term_buf* buf)
|
|||
doom_init(buf);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
matrix_init(buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -591,6 +610,11 @@ static void doom(struct term_buf* term_buf)
|
|||
}
|
||||
}
|
||||
|
||||
static void matrix(struct term_buf* buf)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void animate(struct term_buf* buf)
|
||||
{
|
||||
buf->width = tb_width();
|
||||
|
|
@ -605,6 +629,11 @@ void animate(struct term_buf* buf)
|
|||
doom(buf);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
matrix(buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
14
src/draw.h
14
src/draw.h
|
|
@ -18,6 +18,20 @@ struct box
|
|||
u32 right;
|
||||
};
|
||||
|
||||
struct matrix_dot
|
||||
{
|
||||
int val;
|
||||
bool is_head;
|
||||
};
|
||||
|
||||
struct matrix_state
|
||||
{
|
||||
struct matrix_dot** grid;
|
||||
int* length;
|
||||
int* spaces;
|
||||
int* updates;
|
||||
};
|
||||
|
||||
struct doom_state
|
||||
{
|
||||
u8* buf;
|
||||
|
|
|
|||
Loading…
Reference in New Issue