2018-05-21 18:29:58 +02:00
|
|
|
|
|
|
|
struct _canvas
|
|
|
|
{
|
2020-05-01 21:04:12 +02:00
|
|
|
dword write_text();
|
2018-05-22 14:04:44 +02:00
|
|
|
void draw_hor_line();
|
2018-05-21 18:29:58 +02:00
|
|
|
};
|
|
|
|
|
2020-05-01 21:04:12 +02:00
|
|
|
dword _canvas::write_text(int _x, _y; dword _text_col, _text_off)
|
2018-05-21 18:29:58 +02:00
|
|
|
{
|
|
|
|
char error_message[128];
|
2020-05-01 21:04:12 +02:00
|
|
|
dword new_x;
|
2018-05-22 14:04:44 +02:00
|
|
|
|
2018-05-21 18:29:58 +02:00
|
|
|
if (_x > list.w) {
|
|
|
|
sprintf(#error_message, "ERROR: canvas.x overflow: H %d X %d", kfont.size.height, _x);
|
|
|
|
debugln(#error_message);
|
|
|
|
}
|
|
|
|
if (_y+kfont.size.pt > kfont.size.height) {
|
|
|
|
sprintf(#error_message, "ERROR: canvas.y overflow: H %d Y %d", kfont.size.height, _y);
|
|
|
|
debugln(#error_message);
|
|
|
|
return;
|
|
|
|
}
|
2020-05-01 21:04:12 +02:00
|
|
|
new_x = kfont.WriteIntoBuffer(_x, _y, list.w, kfont.size.height, 0xFFFFFF, _text_col, kfont.size.pt, _text_off);
|
2018-05-21 18:29:58 +02:00
|
|
|
if (_y/list.item_h-list.first==list.visible) DrawPage();
|
2020-05-01 21:04:12 +02:00
|
|
|
return new_x;
|
2018-05-21 18:29:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-05-22 14:04:44 +02:00
|
|
|
void _canvas::draw_hor_line(dword _x, _y, _w, _color)
|
2018-05-21 18:29:58 +02:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = _y*list.w+_x*KFONT_BPP+kfont.raw ; i<_y*list.w+_x+_w*KFONT_BPP+kfont.raw ; i+=KFONT_BPP)
|
|
|
|
{
|
|
|
|
ESDWORD[i] = _color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|