Subversion Repositories Kolibri OS

Rev

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

Rev 4486 Rev 4491
Line 4... Line 4...
4
	char path[4096];
4
	char path[4096];
5
};
5
};
Line 6... Line 6...
6
 
6
 
Line 7... Line 7...
7
s_image pics[100]; //pics = mem_Alloc( 100*sizeof(s_image) );
7
s_image pics[100]; //pics = mem_Alloc( 100*sizeof(s_image) );
8
 
8
 
9
struct ImgCache {
9
struct ImageCache {
10
	int pics_count;
10
	int pics_count;
11
	void Free();
11
	void Free();
12
	int GetImage();
12
	int GetImage();
Line 13... Line 13...
13
	void Images();
13
	void Images();
14
} ImgCache1;
14
};
15
 
15
 
16
void ImgCache::Free()
16
void ImageCache::Free()
17
{
17
{
18
	for ( ; pics_count>0; pics_count--)
18
	for ( ; pics_count>0; pics_count--)
19
	{
19
	{
20
		if (pics[pics_count].image) img_destroy stdcall (pics[pics_count].image);
20
		if (pics[pics_count].image) img_destroy stdcall (pics[pics_count].image);
Line 21... Line 21...
21
		pics[pics_count].path = NULL;
21
		pics[pics_count].path = NULL;
22
	}
22
	}
23
}
23
}
24
 
24
 
25
int ImgCache::GetImage(dword i_path)
25
int ImageCache::GetImage(dword i_path)
26
{
26
{
Line 32... Line 32...
32
	strcpy(#pics[pics_count].path, i_path);
32
	strcpy(#pics[pics_count].path, i_path);
33
	return pics_count;
33
	return pics_count;
34
}
34
}
Line 35... Line 35...
35
 
35
 
36
 
36
 
37
void ImgCache::Images(int left1, top1, width1)
37
void ImageCache::Images(int left1, top1, width1)
38
{
38
{
39
	dword image;
39
	dword image;
Line 96... Line 96...
96
	
96
	
97
	img_draw stdcall (pics[cur_pic].image, left1-5, top1, w, h,0,img_lines_first);
97
	img_draw stdcall (pics[cur_pic].image, left1-5, top1, w, h,0,img_lines_first);
98
	DrawBar(left1+w - 5, top1, WB1.list.w-w, h, bg_color);
98
	DrawBar(left1+w - 5, top1, WB1.list.w-w, h, bg_color);
99
	IF (link) UnsafeDefineButton(left1 - 5, top1, w, h-1, blink + BT_HIDE, 0xB5BFC9);
99
	IF (link) UnsafeDefineButton(left1 - 5, top1, w, h-1, blink + BT_HIDE, 0xB5BFC9);
100
}
100
}
-
 
101
 
-
 
102
ImageCache ImgCache;
101
103