2021-12-16 20:08:12 +01:00
|
|
|
#define MEMSIZE 1024*20
|
2021-12-16 17:51:49 +01:00
|
|
|
#define ENTRY_POINT #main
|
|
|
|
|
|
|
|
#include "../lib/fs.h"
|
|
|
|
#include "../lib/mem.h"
|
|
|
|
#include "../lib/obj/libimg.h"
|
|
|
|
#include "../lib/patterns/rgb.h"
|
|
|
|
|
2021-12-22 02:26:10 +01:00
|
|
|
:unsigned char checkbox_flag[507] = {
|
|
|
|
0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC,
|
|
|
|
0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4,
|
|
|
|
0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xDC, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04,
|
|
|
|
0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC,
|
|
|
|
0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xB4, 0x04, 0xFC, 0xDC,
|
|
|
|
0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xBC, 0x04,
|
|
|
|
0xFC, 0xBC, 0x04, 0xFC, 0xBC, 0x04, 0xFC, 0xB4, 0x04, 0xFC, 0xA9, 0x04, 0xFC, 0xA9, 0x04, 0xFC,
|
|
|
|
0xB4, 0x04, 0xFC, 0xB4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8,
|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04, 0xFA, 0x9F,
|
|
|
|
0x04, 0xF9, 0x98, 0x04, 0xFC, 0xB4, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04,
|
|
|
|
0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9,
|
|
|
|
0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04
|
|
|
|
};
|
|
|
|
|
2021-12-16 17:51:49 +01:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
libimg_image icons32;
|
|
|
|
libimg_image icons16;
|
|
|
|
libimg_image icons16w;
|
|
|
|
unsigned int size32;
|
|
|
|
unsigned int size16;
|
|
|
|
char* shared_i32;
|
|
|
|
char* shared_i16;
|
|
|
|
char* shared_i16w;
|
2021-12-22 02:26:10 +01:00
|
|
|
char* shared_chbox;
|
2021-12-16 17:51:49 +01:00
|
|
|
|
|
|
|
mem_init();
|
|
|
|
load_dll(libimg, #libimg_init, 1);
|
|
|
|
@SetEventMask(EVM_DESKTOPBG);
|
|
|
|
|
2021-12-22 02:26:10 +01:00
|
|
|
shared_chbox = memopen("CHECKBOX", sizeof(checkbox_flag), SHM_CREATE+SHM_WRITE);
|
|
|
|
memmov(shared_chbox, #checkbox_flag, sizeof(checkbox_flag));
|
|
|
|
|
2021-12-16 17:51:49 +01:00
|
|
|
icons32.load("/sys/icons32.png"); size32 = icons32.h * 32 * 4;
|
|
|
|
icons16.load("/sys/icons16.png"); size16 = icons16.h * 18 * 4;
|
|
|
|
|
|
|
|
shared_i32 = memopen("ICONS32", size32, SHM_CREATE+SHM_WRITE);
|
|
|
|
memmov(shared_i32, icons32.imgsrc, size32);
|
2021-12-16 20:08:12 +01:00
|
|
|
img_destroy stdcall(icons32.image);
|
2021-12-16 17:51:49 +01:00
|
|
|
|
|
|
|
shared_i16 = memopen("ICONS18", size16, SHM_CREATE + SHM_WRITE);
|
|
|
|
memmov(shared_i16, icons16.imgsrc, size16);
|
2021-12-16 20:08:12 +01:00
|
|
|
img_destroy stdcall(icons16.image);
|
2021-12-16 17:51:49 +01:00
|
|
|
|
|
|
|
shared_i16w = memopen("ICONS18W", size16, SHM_CREATE + SHM_WRITE);
|
|
|
|
|
|
|
|
UPDATE_ICONS18WORK:
|
|
|
|
$push sc.work
|
|
|
|
sc.get();
|
|
|
|
$pop eax
|
2021-12-18 16:21:21 +01:00
|
|
|
if (sc.work != EAX) {
|
2021-12-16 17:51:49 +01:00
|
|
|
icons16w.load("/sys/icons16.png");
|
|
|
|
icons16w.replace_2colors(0xffFFFfff, sc.work, 0xffCACBD6, MixColors(sc.work, 0, 200));
|
|
|
|
memmov(shared_i16w, icons16w.imgsrc, size16);
|
2021-12-16 20:08:12 +01:00
|
|
|
img_destroy stdcall(icons16w.image);
|
2021-12-18 16:21:21 +01:00
|
|
|
icons16w.image = NULL;
|
2021-12-16 17:51:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
loop() IF(WaitEvent()==evDesktop) GOTO UPDATE_ICONS18WORK;
|
|
|
|
}
|
2021-12-22 02:26:10 +01:00
|
|
|
|