Rev 7977 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7977 | Rev 7978 | ||
---|---|---|---|
Line 8... | Line 8... | ||
8 | :struct libimg_image { |
8 | :struct libimg_image { |
9 | dword image, w, h, imgsrc; |
9 | dword image, w, h, imgsrc; |
10 | void load_as24b(); |
10 | void load_as24b(); |
11 | void load(); |
11 | void load(); |
12 | void replace_color(); |
12 | void replace_color(); |
13 | void fill_transparent(); |
- | |
14 | } skin; |
13 | } skin; |
Line 15... | Line 14... | ||
15 | 14 | ||
16 | :void libimg_image::load_as24b(dword file_path) |
15 | :void libimg_image::load_as24b(dword file_path) |
17 | { |
16 | { |
Line 48... | Line 47... | ||
48 | dword i, max_i; |
47 | dword i, max_i; |
49 | max_i = w * h * 4 + imgsrc; |
48 | max_i = w * h * 4 + imgsrc; |
50 | for (i = imgsrc; i < max_i; i += 4) if (DSDWORD[i]==old_color) DSDWORD[i] = new_color; |
49 | for (i = imgsrc; i < max_i; i += 4) if (DSDWORD[i]==old_color) DSDWORD[i] = new_color; |
51 | } |
50 | } |
Line 52... | Line -... | ||
52 | - | ||
53 | :void libimg_image::fill_transparent(new_color) |
- | |
54 | { |
- | |
55 | if (new_color) replace_color(0, new_color); |
- | |
56 | } |
- | |
57 | 51 | ||
58 | :libimg_image icons32draw; |
52 | :libimg_image icons32draw; |
59 | :void DrawIcon32(dword x,y, bg, icon_n) { |
53 | :void DrawIcon32(dword x,y, bg, icon_n) { |
60 | //load_dll(libimg, #libimg_init,1); |
54 | //load_dll(libimg, #libimg_init,1); |
61 | if (!icons32draw.image) { |
55 | if (!icons32draw.image) { |
62 | icons32draw.load("/sys/icons32.png"); |
56 | icons32draw.load("/sys/icons32.png"); |
63 | icons32draw.fill_transparent(bg); |
57 | icons32draw.replace_color(0x00000000, bg); |
64 | } |
58 | } |
65 | if (icon_n>=0) img_draw stdcall(icons32draw.image, x, y, 32, 32, 0, icon_n*32); |
59 | if (icon_n>=0) img_draw stdcall(icons32draw.image, x, y, 32, 32, 0, icon_n*32); |
Line 66... | Line 60... | ||
66 | } |
60 | } |