mirror of
https://github.com/kiedtl/fire.git
synced 2024-11-16 04:56:38 +00:00
fix some minor bugs
This commit is contained in:
parent
f1b427d6cb
commit
115753a1ea
4
colors.h
4
colors.h
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#define RED 0xdd1111
|
#define RED 0xdd1111
|
||||||
#define BLACK 0x000000
|
#define BLACK 0x000000
|
||||||
#define YELLOW 0xffdd00
|
#define YELLOW 0xff7700
|
||||||
#define WHITE 0xffffff
|
#define WHITE 0xffffff
|
||||||
|
|
||||||
struct tb_cell normcolors[CLRS_LEN] =
|
struct tb_cell normcolors[CLRS_LEN] =
|
||||||
@ -37,7 +37,7 @@ struct tb_cell normcolors[CLRS_LEN] =
|
|||||||
struct tb_cell truecolors[CLRS_LEN] =
|
struct tb_cell truecolors[CLRS_LEN] =
|
||||||
{
|
{
|
||||||
// default
|
// default
|
||||||
{ ' ', 9, 0 },
|
{ ' ', 9, 0 },
|
||||||
|
|
||||||
// red/black
|
// red/black
|
||||||
{ 0x2591, RED, BLACK },
|
{ 0x2591, RED, BLACK },
|
||||||
|
16
draw.c
16
draw.c
@ -66,15 +66,13 @@ dofire ( struct buffer *buf )
|
|||||||
if (buf->buf[dest] > 12)
|
if (buf->buf[dest] > 12)
|
||||||
buf->buf[dest] = 0;
|
buf->buf[dest] = 0;
|
||||||
|
|
||||||
if (opts->truecolor) {
|
struct tb_cell *colors;
|
||||||
realbuf[dest] = truecolors[buf->buf[dest]];
|
if (opts->truecolor == TRUE)
|
||||||
realbuf[src] = truecolors[buf->buf[src]];
|
colors = (struct tb_cell*) &truecolors;
|
||||||
}
|
else colors = (struct tb_cell*) &normcolors;
|
||||||
else
|
|
||||||
{
|
realbuf[dest] = colors[buf->buf[dest]];
|
||||||
realbuf[dest] = normcolors[buf->buf[dest]];
|
realbuf[src] = colors[buf->buf[src]];
|
||||||
realbuf[src] = normcolors[buf->buf[src]];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
5
main.c
5
main.c
@ -25,13 +25,14 @@ main ( int argc, char *argv[] )
|
|||||||
// default args
|
// default args
|
||||||
opts->refresh_rate = 5;
|
opts->refresh_rate = 5;
|
||||||
opts->truecolor = FALSE;
|
opts->truecolor = FALSE;
|
||||||
|
usize output_mode = TB_OUTPUT_NORMAL;
|
||||||
|
|
||||||
// argument parsing
|
// argument parsing
|
||||||
argv0 = argv[0];
|
argv0 = argv[0];
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
case 't':
|
case 't':
|
||||||
tb_select_output_mode(TB_OUTPUT_TRUECOLOR);
|
output_mode = TB_OUTPUT_TRUECOLOR;
|
||||||
opts->truecolor = TRUE;
|
opts->truecolor = TRUE;
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
@ -53,7 +54,7 @@ main ( int argc, char *argv[] )
|
|||||||
|
|
||||||
// initialize termbox
|
// initialize termbox
|
||||||
tb_init();
|
tb_init();
|
||||||
tb_select_output_mode(TB_OUTPUT_NORMAL);
|
tb_select_output_mode(output_mode);
|
||||||
tb_clear();
|
tb_clear();
|
||||||
struct buffer buf;
|
struct buffer buf;
|
||||||
struct tb_event e;
|
struct tb_event e;
|
||||||
|
Loading…
Reference in New Issue
Block a user