Subversion Repositories Kolibri OS

Rev

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

Rev 5408 Rev 5409
Line 1... Line 1...
1
struct libimg_image {
1
struct libimg_image {
2
	dword image, w, h;
2
	dword image, w, h;
3
};
3
};
Line 4... Line 4...
4
 
4
 
5
int Libimg_LoadImage(dword struct_pointer, file_path)
5
:void Libimg_LoadImage(dword struct_pointer, file_path)
6
{
6
{
7
	int image_pointer;
7
	dword image_pointer;
8
	image_pointer = load_image(file_path);
8
	image_pointer = load_image(file_path);
9
	if (!image_pointer) notify("Error: Skin not loaded");
9
	if (!image_pointer) notify("Error: Image not loaded");
10
	ESDWORD[struct_pointer] = image_pointer;
10
	ESDWORD[struct_pointer] = image_pointer;
11
	ESDWORD[struct_pointer+4] = DSWORD[image_pointer+4];
11
	ESDWORD[struct_pointer+4] = DSWORD[image_pointer+4];
12
	ESDWORD[struct_pointer+8] = DSWORD[image_pointer+8];
12
	ESDWORD[struct_pointer+8] = DSWORD[image_pointer+8];
13
}
13
}
-
 
14
 
-
 
15
:void Libimg_FillTransparent(dword struct_pointer, w, h, new_transparent_color)
-
 
16
{
-
 
17
	dword i, max_i, image_data;
-
 
18
	image_data = ESDWORD[struct_pointer + 24];
-
 
19
	max_i =  w * h * 4 + image_data;
-
 
20
	for (i = image_data; i < max_i; i += 4)	if (DSDWORD[i]==0) DSDWORD[i] = new_transparent_color;
-
 
21
}
14
22