Rev 9428 | Rev 9455 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
9428 | leency | 1 | #define MEMSIZE 1024*20 |
9426 | leency | 2 | #define ENTRY_POINT #main |
3 | |||
4 | #include "../lib/fs.h" |
||
5 | #include "../lib/mem.h" |
||
6 | #include "../lib/obj/libimg.h" |
||
7 | #include "../lib/patterns/rgb.h" |
||
8 | |||
9 | void main() |
||
10 | { |
||
11 | libimg_image icons32; |
||
12 | libimg_image icons16; |
||
13 | libimg_image icons16w; |
||
14 | unsigned int size32; |
||
15 | unsigned int size16; |
||
16 | char* shared_i32; |
||
17 | char* shared_i16; |
||
18 | char* shared_i16w; |
||
19 | |||
20 | mem_init(); |
||
21 | load_dll(libimg, #libimg_init, 1); |
||
22 | @SetEventMask(EVM_DESKTOPBG); |
||
23 | |||
24 | icons32.load("/sys/icons32.png"); size32 = icons32.h * 32 * 4; |
||
25 | icons16.load("/sys/icons16.png"); size16 = icons16.h * 18 * 4; |
||
26 | |||
27 | shared_i32 = memopen("ICONS32", size32, SHM_CREATE+SHM_WRITE); |
||
28 | memmov(shared_i32, icons32.imgsrc, size32); |
||
9428 | leency | 29 | img_destroy stdcall(icons32.image); |
9426 | leency | 30 | |
31 | shared_i16 = memopen("ICONS18", size16, SHM_CREATE + SHM_WRITE); |
||
32 | memmov(shared_i16, icons16.imgsrc, size16); |
||
9428 | leency | 33 | img_destroy stdcall(icons16.image); |
9426 | leency | 34 | |
35 | shared_i16w = memopen("ICONS18W", size16, SHM_CREATE + SHM_WRITE); |
||
36 | |||
37 | UPDATE_ICONS18WORK: |
||
38 | $push sc.work |
||
39 | sc.get(); |
||
40 | $pop eax |
||
9439 | leency | 41 | if (sc.work != EAX) { |
9426 | leency | 42 | icons16w.load("/sys/icons16.png"); |
43 | icons16w.replace_2colors(0xffFFFfff, sc.work, 0xffCACBD6, MixColors(sc.work, 0, 200)); |
||
44 | memmov(shared_i16w, icons16w.imgsrc, size16); |
||
9428 | leency | 45 | img_destroy stdcall(icons16w.image); |
9439 | leency | 46 | icons16w.image = NULL; |
9426 | leency | 47 | } |
48 | |||
49 | loop() IF(WaitEvent()==evDesktop) GOTO UPDATE_ICONS18WORK; |
||
50 | } |