Rev 7285 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7285 | Rev 7286 | ||
---|---|---|---|
1 | struct _canvas |
1 | struct _canvas |
2 | { |
2 | { |
3 | void write_text(); |
3 | void write_text(); |
4 | void draw_bar(); |
4 | void draw_hor_line(); |
5 | }; |
5 | }; |
6 | 6 | ||
7 | void _canvas::write_text(int _x, _y; dword _text_col, _text_off) |
7 | void _canvas::write_text(int _x, _y; dword _text_col, _text_off) |
8 | { |
8 | { |
9 | char error_message[128]; |
9 | char error_message[128]; |
10 | if (_x > list.w) { |
10 | |
- | 11 | if (_x > list.w) { |
|
11 | sprintf(#error_message, "ERROR: canvas.x overflow: H %d X %d", kfont.size.height, _x); |
12 | sprintf(#error_message, "ERROR: canvas.x overflow: H %d X %d", kfont.size.height, _x); |
12 | debugln(#error_message); |
13 | debugln(#error_message); |
13 | } |
14 | } |
14 | if (_y+kfont.size.pt > kfont.size.height) { |
15 | if (_y+kfont.size.pt > kfont.size.height) { |
15 | sprintf(#error_message, "ERROR: canvas.y overflow: H %d Y %d", kfont.size.height, _y); |
16 | sprintf(#error_message, "ERROR: canvas.y overflow: H %d Y %d", kfont.size.height, _y); |
16 | debugln(#error_message); |
17 | debugln(#error_message); |
17 | return; |
18 | return; |
18 | } |
19 | } |
19 | kfont.WriteIntoBuffer(_x, _y, list.w, kfont.size.height, 0xFFFFFF, _text_col, kfont.size.pt, _text_off); |
20 | kfont.WriteIntoBuffer(_x, _y, list.w, kfont.size.height, 0xFFFFFF, _text_col, kfont.size.pt, _text_off); |
20 | if (_y/list.item_h-list.first==list.visible) DrawPage(); |
21 | if (_y/list.item_h-list.first==list.visible) DrawPage(); |
21 | } |
22 | } |
22 | 23 | ||
23 | 24 | ||
24 | void _canvas::draw_bar(dword _x, _y, _w, _color) |
25 | void _canvas::draw_hor_line(dword _x, _y, _w, _color) |
25 | { |
26 | { |
26 | int i; |
27 | int i; |
27 | for (i = _y*list.w+_x*KFONT_BPP+kfont.raw ; i<_y*list.w+_x+_w*KFONT_BPP+kfont.raw ; i+=KFONT_BPP) |
28 | for (i = _y*list.w+_x*KFONT_BPP+kfont.raw ; i<_y*list.w+_x+_w*KFONT_BPP+kfont.raw ; i+=KFONT_BPP) |
28 | { |
29 | { |
29 | ESDWORD[i] = _color; |
30 | ESDWORD[i] = _color; |
30 | } |
31 | } |
31 | } |
32 | } |