Subversion Repositories Kolibri OS

Rev

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

Rev 5814 Rev 5816
Line 13... Line 13...
13
{
13
{
14
	signed x,y;
14
	signed x,y;
15
};
15
};
16
:struct __SIZE
16
:struct __SIZE
17
{
17
{
18
	word width,height;
18
	dword width,height;
19
	__OFFSET_FONT offset;
19
	__OFFSET_FONT offset;
20
	float offset_i,w_italic;
20
	float offset_i,w_italic;
21
	byte text;
21
	byte text;
22
	byte TMP_WEIGHT;
22
	byte TMP_WEIGHT;
23
};
23
};
Line 37... Line 37...
37
	dword begin;
37
	dword begin;
38
	byte load(...);
38
	byte load(...);
39
	byte symbol(word x,y;byte s;dword c);
39
	byte symbol(word x,y;byte s;dword c);
40
	byte symbol_size(byte s);
40
	byte symbol_size(byte s);
41
	dword prepare(word x,y;dword text1);
41
	dword prepare(word x,y;dword text1);
42
	void prepare_buf(word x,y,w,h;dword text1);
42
	void prepare_buf(dword x,y,w,h, text1);
43
	void show();
43
	void show();
44
	byte textcenter(word x,y,w,h;dword txt);
44
	byte textcenter(word x,y,w,h;dword txt);
45
	dword getsize(dword text1);
45
	dword getsize(dword text1);
46
	byte changeSIZE();
46
	byte changeSIZE();
47
	void PixelRGB(word x,y);
47
	void PixelRGB(dword x,y);
48
	//dword GetPixel(word x,y);
48
	//dword GetPixel(word x,y);
49
	byte no_bg_copy;
49
	byte no_bg_copy;
50
	dword bg_color;
50
	dword bg_color;
51
};
51
};
52
FONT font = 0;
52
FONT font = 0;
Line 59... Line 59...
59
	g = DSBYTE[tmp]; tmp++;
59
	g = DSBYTE[tmp]; tmp++;
60
	b = DSBYTE[tmp];
60
	b = DSBYTE[tmp];
61
}*/
61
}*/
62
:void FONT::PixelRGB(dword x,y)
62
:void FONT::PixelRGB(dword x,y)
63
{
63
{
64
	$push ebx 
-
 
65
	EBX = y*size.width+x*3 + buffer;
64
	dword offs = y*size.width+x*3 + buffer;
66
	DSBYTE[EBX] = r; EBX++;
65
	DSBYTE[offs] = r; offs++;
67
	DSBYTE[EBX] = g; EBX++;
66
	DSBYTE[offs] = g; offs++;
68
	DSBYTE[EBX] = b;
67
	DSBYTE[offs] = b;
69
	$pop ebx
-
 
70
}
68
}
71
:byte FONT::changeSIZE()
69
:byte FONT::changeSIZE()
72
{
70
{
73
	dword TMP_DATA;
71
	dword TMP_DATA;
74
	dword ofs;
72
	dword ofs;
Line 318... Line 316...
318
	width = DSBYTE[EBX];
316
	width = DSBYTE[EBX];
319
	block = math.ceil(height*width/32);
317
	block = math.ceil(height*width/32);
320
	return true;
318
	return true;
321
}
319
}
Line 322... Line 320...
322
 
320
 
323
:void FONT::prepare_buf(word x,y,w,h; dword text1)
321
:void FONT::prepare_buf(dword x,y,w,h; dword text1)
324
{
322
{
325
	dword c;
323
	dword c, new_buffer_size;
326
	c = color;
324
	c = color;
327
	IF(!text1)return;
325
	IF(!text1)return;
328
	IF(size.text)IF(!changeSIZE())return;
326
	IF(size.text)IF(!changeSIZE())return;
329
	AX = c; r = AL; g = AH; c>>=16; AX = c; b = AL;
327
	AX = c; r = AL; g = AH; c>>=16; AX = c; b = AL;
330
	getsize(text1);
328
	getsize(text1);
Line 331... Line 329...
331
	y -= size.offset.y;
329
	y -= size.offset.y;
332
	
330
	
Line 333... Line 331...
333
	size.width = w;
331
	size.width = w;
334
	size.height = h;
332
	size.height = h;
335
 
333
 
336
	EDX = size.width*size.height*3;
334
	new_buffer_size = w*h*3;
337
	IF(buffer_size!=EDX)
335
	IF(buffer_size!=new_buffer_size)
338
	{
336
	{
339
		buffer_size = EDX; 
337
		buffer_size = new_buffer_size; 
340
		free(buffer);
338
		free(buffer);
341
		buffer = malloc(buffer_size); 
339
		buffer = malloc(buffer_size);
342
		EBX = font.bg_color;
340
		EBX = bg_color;
343
		EDI = font.buffer;
341
		EDI = buffer;
344
		EAX = font.buffer_size+font.buffer;
342
		EAX = buffer_size+buffer;
345
		WHILE (EDI
343
		WHILE (EDI
346
		{
344
		{