-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathdraw.c
58 lines (49 loc) · 1.24 KB
/
draw.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <curses.h>
#include "lottypes.h"
#include "lotdefs.h"
#include "ttydraw.h"
// The canvas used for drawing ascii-art graphics.
extern caca_canvas_t *cv;
void exprt_scan_linx(int x, int y, int width, int attr)
{
caca_set_attr(cv, attr);
caca_draw_thin_line(cv, x, y, x + width, y);
refresh();
return;
}
void exprt_fill_rect(int x, int y, int width, int height, int attr)
{
caca_set_attr(cv, attr);
caca_fill_box(cv, x, y, width, height, ' ');
refresh();
return;
}
void exprt_thin_diag_line(int x1, int y1, int x2, int y2, int attr)
{
caca_set_attr(cv, attr);
caca_draw_thin_line(cv, x1, y1, x2, y2);
refresh();
return;
}
void exprt_thin_vert_line(int x, int y, int height, int attr)
{
caca_set_attr(cv, attr);
caca_draw_thin_line(cv, x, y, x, y + height);
refresh();
return;
}
// This is called for cross hatching, pattern fills.
void exprt_shade_rect(struct POINT origin,
struct POINT dim,
PATT *fillpat,
uint16_t fillcolor)
{
caca_set_attr(cv, fillcolor);
caca_fill_box(cv, origin.ptx, origin.pty, dim.ptx, dim.pty, fillpat->pattptr[0]);
refresh();
return;
}
void exprt_fill_scan_list()
{
return;
}