Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.  
  2. :bool draw_icon_32(dword _x,_y, _bg, _icon_n) {
  3.         static dword bg;
  4.         static dword shared;
  5.         static dword icon32mem;
  6.         dword size;
  7.         if (!shared) || (bg!=_bg) {
  8.                 if (shared = memopen("ICONS32", NULL, SHM_READ))
  9.                 {
  10.                         size = EDX;
  11.                         if (!icon32mem) icon32mem = malloc(size);
  12.                         memmov(icon32mem, shared, size);
  13.                         EDX = icon32mem + size;
  14.                         EAX = bg = _bg;
  15.                         for (ESI = icon32mem; ESI < EDX; ESI += 4) {
  16.                                 if (DSDWORD[ESI]==0x00000000) DSDWORD[ESI] = EAX;
  17.                         }                      
  18.                 }
  19.         }
  20.         if (icon32mem) {
  21.                 PutPaletteImage(32*32*4*_icon_n + icon32mem, 32, 32,_x, _y, 32, 0);
  22.                 return true;
  23.         }
  24.         return false;
  25. }
  26.  
  27. :bool draw_icon_16(dword _x,_y, _icon_n) {
  28.         static dword shared_i16;
  29.         if (!shared_i16) shared_i16 = memopen("ICONS18", NULL, SHM_READ);
  30.         if (shared_i16) {
  31.                 PutPaletteImage(18*18*4*_icon_n + shared_i16, 18, 18,_x, _y, 32, 0);
  32.                 return true;
  33.         }
  34.         return false;
  35. }
  36.  
  37. :bool draw_icon_16w(dword _x,_y, _icon_n) {
  38.         static dword shared_i16w;
  39.         if (!shared_i16w) shared_i16w = memopen("ICONS18W", NULL, SHM_READ);
  40.         if (shared_i16w) {
  41.                 PutPaletteImage(18*18*4*_icon_n + shared_i16w, 18, 18,_x, _y, 32, 0);
  42.                 return true;
  43.         }
  44.         return false;
  45. }
  46.