Rev 8013 | Rev 8382 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8013 | Rev 8381 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | 12 | ||
13 | #ifndef INCLUDE_DLL_H |
13 | #ifndef INCLUDE_DLL_H |
14 | #include "../lib/dll.h" |
14 | #include "../lib/dll.h" |
Line 15... | Line -... | ||
15 | #endif |
- | |
16 | - | ||
17 | #ifndef INCLUDE_LIBIO_H |
- | |
18 | #include "../lib/obj/libio.h" |
- | |
19 | #endif |
15 | #endif |
20 | 16 | ||
21 | //library |
17 | //library |
Line 22... | Line 18... | ||
22 | dword libimg = #alibimg; |
18 | dword libimg = #alibimg; |
Line 29... | Line 25... | ||
29 | dword img_destroy = #aimg_destroy; |
25 | dword img_destroy = #aimg_destroy; |
30 | dword img_draw = #aimg_draw; |
26 | dword img_draw = #aimg_draw; |
31 | dword img_create = #aimg_create; |
27 | dword img_create = #aimg_create; |
32 | dword img_encode = #aimg_encode; |
28 | dword img_encode = #aimg_encode; |
33 | dword img_convert = #aimg_convert; |
29 | dword img_convert = #aimg_convert; |
- | 30 | dword img_from_file = #aimg_from_file; |
|
Line 34... | Line 31... | ||
34 | 31 | ||
35 | //dword img_flip = #aimg_flip; |
32 | //dword img_flip = #aimg_flip; |
36 | //dword img_rotate = #aimg_rotate; |
33 | //dword img_rotate = #aimg_rotate; |
Line 44... | Line 41... | ||
44 | char aimg_destroy[] = "img_destroy"; |
41 | char aimg_destroy[] = "img_destroy"; |
45 | char aimg_draw[] = "img_draw"; |
42 | char aimg_draw[] = "img_draw"; |
46 | char aimg_create[] = "img_create"; |
43 | char aimg_create[] = "img_create"; |
47 | char aimg_encode[] = "img_encode"; |
44 | char aimg_encode[] = "img_encode"; |
48 | char aimg_convert[] = "img_convert"; |
45 | char aimg_convert[] = "img_convert"; |
- | 46 | char aimg_from_file[] = "img_from_file"; |
|
49 | //char aimg_flip[] = "img_flip"; |
47 | //char aimg_flip[] = "img_flip"; |
50 | //char aimg_rotate[] = "img_rotate "; |
48 | //char aimg_rotate[] = "img_rotate "; |
Line 51... | Line 49... | ||
51 | 49 | ||
Line 290... | Line 288... | ||
290 | // DRAW ICON PATTERN / TEMP |
288 | // DRAW ICON PATTERN / TEMP |
291 | */ |
289 | */ |
292 | ///////////////////////////// |
290 | ///////////////////////////// |
Line 293... | Line 291... | ||
293 | 291 | ||
294 | :void DrawIcon32(dword x,y, _bg, icon_n) { |
- | |
295 | static libimg_image i32; |
292 | :void DrawIcon32(dword x,y, _bg, icon_n) { |
296 | static dword bg; |
293 | static dword bg; |
297 | //load_dll(libimg, #libimg_init,1); |
294 | static dword pure_img32; |
298 | if (!i32.image) || (bg!=_bg) { |
295 | if (!pure_img32) || (bg!=_bg) { |
299 | bg = _bg; |
296 | bg = _bg; |
- | 297 | img_from_file stdcall("/sys/icons32.png"); |
|
- | 298 | pure_img32 = EAX; |
|
- | 299 | //now fill transparent with another color |
|
- | 300 | EDX = ESDWORD[EAX+4] * ESDWORD[EAX+8] * 4 + ESDWORD[EAX+24]; |
|
300 | i32.load("/sys/icons32.png"); |
301 | for (ESI = ESDWORD[EAX+24]; ESI < EDX; ESI += 4) { |
301 | i32.replace_color(0x00000000, bg); |
302 | if (DSDWORD[ESI]==0x00000000) DSDWORD[ESI] = bg; |
- | 303 | } |
|
302 | } |
304 | } |
303 | if (icon_n>=0) i32.draw(x, y, 32, 32, 0, icon_n*32); |
305 | img_draw stdcall(pure_img32, x, y, 32, 32, 0, icon_n*32); |
Line 304... | Line 306... | ||
304 | } |
306 | } |
- | 307 | ||
305 | 308 | :void DrawIcon16(dword x,y, _bg, icon_n) { |
|
- | 309 | static dword bg; |
|
306 | :void DrawIcon16(dword x,y, bg, icon_n) { |
310 | static dword pure_img16; |
307 | static libimg_image i16; |
311 | dword bgshadow; |
- | 312 | if (!pure_img16) || (bg!=_bg) { |
|
308 | //load_dll(libimg, #libimg_init,1); |
313 | bg = _bg; |
- | 314 | bgshadow = MixColors(bg, 0, 220); |
|
- | 315 | img_from_file stdcall("/sys/icons16.png"); |
|
- | 316 | pure_img16 = EAX; |
|
- | 317 | //now fill transparent with another color |
|
309 | if (!i16.image) { |
318 | EDX = ESDWORD[EAX+4] * ESDWORD[EAX+8] * 4 + ESDWORD[EAX+24]; |
310 | i16.load("/sys/icons16.png"); |
319 | for (ESI = ESDWORD[EAX+24]; ESI < EDX; ESI += 4) { |
311 | i16.replace_color(0xffFFFfff, bg); |
320 | if (DSDWORD[ESI]==0xffFFFfff) DSDWORD[ESI] = bg; |
312 | i16.replace_color(0xffCACBD6, MixColors(bg, 0, 220)); |
- | |
313 | } |
321 | if (DSDWORD[ESI]==0xffCACBD6) DSDWORD[ESI] = bgshadow; |
- | 322 | } |
|
314 | if (icon_n>=0) i16.draw(x, y, 16, 16, 0, icon_n*16); |
323 | } |
Line 315... | Line 324... | ||
315 | } |
324 | img_draw stdcall(pure_img16, x, y, 16, 16, 0, icon_n*16); |
316 | 325 | } |