Subversion Repositories Kolibri OS

Rev

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

Rev 4486 Rev 4666
Line 1... Line 1...
1
dword buf_data;
1
dword buf_data;
Line 2... Line 2...
2
 
2
 
3
struct DrawBufer {
3
struct DrawBufer {
Line 4... Line 4...
4
	int bufx, bufy, bufw, bufh, buf_line_h;
4
	int bufx, bufy, bufw, bufh;
-
 
5
 
5
 
6
	void Init();
6
	void Init();
7
	void Show();
7
	void Fill();
8
	void Fill();
-
 
9
	void Skew();
8
	void Skew();
10
	void DrawBar();
9
	void DrawBar();
11
	void PutPixel();
10
	void AlignCenter();
12
	void AlignCenter();
Line 11... Line 13...
11
	void AlignRight();
13
	void AlignRight();
12
};
14
};
13
 
15
 
14
void DrawBufer::Init(int i_bufx, i_bufy, i_bufw, i_bufh, i_buf_line_h)
16
void DrawBufer::Init(int i_bufx, i_bufy, i_bufw, i_bufh)
15
{
17
{
16
	bufx = i_bufx;
18
	bufx = i_bufx;
17
	bufy = i_bufy;
-
 
18
	bufw = i_bufw; 
19
	bufy = i_bufy;
19
	bufh = i_bufh;
20
	bufw = i_bufw; 
20
	buf_line_h = i_buf_line_h;
21
	bufh = i_bufh;
21
	free(buf_data);
22
	free(buf_data);
-
 
23
	buf_data = malloc(bufw * bufh * 4 + 8); //+1 for good luck
-
 
24
	ESDWORD[buf_data] = bufw;
-
 
25
	ESDWORD[buf_data+4] = bufh;
-
 
26
}
-
 
27
 
22
	buf_data = malloc(bufw * buf_line_h +4 * 4 + 8); //+1 for good luck
28
void DrawBufer::Show()
Line 23... Line 29...
23
	ESDWORD[buf_data] = bufw;
29
{
24
	ESDWORD[buf_data+4] = buf_line_h;
30
	PutPaletteImage(buf_data+8, bufw, bufh, bufx, bufy, 32,0);
25
}
31
}
26
 
32
 
27
void DrawBufer::Fill(dword fill_color)
33
void DrawBufer::Fill(dword fill_color)
28
{
34
{
Line 29... Line 35...
29
	int i;
35
	int i;
30
	int max_i = bufw * buf_line_h + 4 * 4 + buf_data +8;
36
	int max_i = bufw * bufh * 4 + buf_data + 8;
Line 39... Line 45...
39
		for (i = y+j*bufw+x*4+8+buf_data; i
45
		for (i = y+j*bufw+x*4+8+buf_data; i
40
	}
46
	}
41
}
47
}
42
 
48
 
Line -... Line 49...
-
 
49
void DrawBufer::PutPixel(dword x, y, color)
-
 
50
{
-
 
51
	int pos = y*bufw+x*4+8+buf_data;
-
 
52
	ESDWORD[pos] = color;
-
 
53
}
-
 
54
 
43
char shift[]={8,8,4,4};
55
char shift[]={8,8,4,4};
44
void DrawBufer::Skew(dword x, y, w, h)
56
void DrawBufer::Skew(dword x, y, w, h)
45
{
57
{
46
	int i, j;
58
	int i, j;
47
	for (j=0; j<=3; j++)
59
	for (j=0; j<=3; j++)