Subversion Repositories Kolibri OS

Rev

Rev 4411 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4411 Rev 4414
Line 1... Line 1...
1
dword drawbuf;
1
dword drawbuf;
2
void DrawBufInit()
2
void DrawBufInit()
3
{
3
{
4
	free(drawbuf);
4
	free(drawbuf);
5
	drawbuf = malloc(WB1.width * WB1.line_h +4 * 4 + 8); //+1 for good luck
5
	drawbuf = malloc(WB1.list.w * WB1.list.line_h +4 * 4 + 8); //+1 for good luck
6
	ESDWORD[drawbuf] = WB1.width;
6
	ESDWORD[drawbuf] = WB1.list.w;
7
	ESDWORD[drawbuf+4] = WB1.line_h;
7
	ESDWORD[drawbuf+4] = WB1.list.line_h;
8
}
8
}
9
void DrawBufFill()
9
void DrawBufFill()
10
{
10
{
11
	int i;
11
	int i;
12
	for (i=0; i
12
	for (i=0; i
13
}
13
}
14
void DrawBufBar(dword x, y, w, h, color)
14
void DrawBufBar(dword x, y, w, h, color)
15
{
15
{
16
	int i, j;
16
	int i, j;
17
	for (j=0; j
17
	for (j=0; j
18
	{
18
	{
19
		for (i = y+j*WB1.width+x*4; i
19
		for (i = y+j*WB1.list.w+x*4; i
20
	}
20
	}
21
}
21
}
Line 22... Line 22...
22
 
22
 
23
char shift[]={8,8,4,4};
23
char shift[]={8,8,4,4};
24
void DrawBufSkew(dword x, y, w, h)
24
void DrawBufSkew(dword x, y, w, h)
25
{
25
{
26
	int i, j;
26
	int i, j;
27
	stolbec++;
27
	stolbec++;
28
	for (j=0; j<=3; j++)
28
	for (j=0; j<=3; j++)
29
	{
29
	{
30
		for (i = y+j*WB1.width+x+w+h*4; i>y+j*WB1.width+x+h-12*4 ; i-=4)
30
		for (i = y+j*WB1.list.w+x+w+h*4; i>y+j*WB1.list.w+x+h-12*4 ; i-=4)
31
								ESDWORD[drawbuf+i+8] = ESDWORD[-shift[j]+drawbuf+i+8];
31
								ESDWORD[drawbuf+i+8] = ESDWORD[-shift[j]+drawbuf+i+8];
32
	}
32
	}
Line 33... Line 33...
33
}
33
}
Line 62... Line 62...
62
}
62
}
Line 63... Line 63...
63
 
63
 
64
 
64
 
65
void TextGoDown(int left1, top1, width1)
65
void TextGoDown(int left1, top1, width1)
66
{
66
{
67
	if (!stroka) DrawBar(WB1.left, WB1.top, WB1.width, 5, bg_color); //çàêðàøèâàåì ôîí íàä ïåðâîé ñòðîêîé
67
	if (!stroka) DrawBar(WB1.list.x, WB1.list.y, WB1.list.w, 5, bg_color); //çàêðàøèâàåì ôîí íàä ïåðâîé ñòðîêîé
68
	if (top1>=WB1.top) && ( top1 < WB1.height+WB1.top-10)  && (!anchor)
68
	if (top1>=WB1.list.y) && ( top1 < WB1.list.h+WB1.list.y-10)  && (!anchor)
69
	{
69
	{
70
		if (text_align == ALIGN_CENTER) DrawBufAlignCenter(left1,top1,WB1.width,WB1.line_h);
70
		if (text_align == ALIGN_CENTER) DrawBufAlignCenter(left1,top1,WB1.list.w,WB1.list.line_h);
71
		if (text_align == ALIGN_RIGHT) DrawBufAlignRight(left1,top1,WB1.width,WB1.line_h);
71
		if (text_align == ALIGN_RIGHT) DrawBufAlignRight(left1,top1,WB1.list.w,WB1.list.line_h);
72
		PutPaletteImage(drawbuf+8, WB1.width, WB1.line_h, left1-5, top1, 32,0);
72
		PutPaletteImage(drawbuf+8, WB1.list.w, WB1.list.line_h, left1-5, top1, 32,0);
73
		DrawBufFill();
73
		DrawBufFill();
74
	}
74
	}
75
	stroka++;
75
	stroka++;