Subversion Repositories Kolibri OS

Rev

Rev 7205 | Rev 8442 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. use32
  2.         org 0
  3.         db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
  4.         dd 1,start,i_end,mem,stacktop,openfile_path,sys_path
  5.  
  6. include '../../../../programs/macros.inc'
  7. include '../../../../programs/proc32.inc'
  8. include '../../../../programs/KOSfuncs.inc'
  9. include '../../../../programs/load_img.inc'
  10. include '../trunk/str.inc'
  11. include 'lang.inc'
  12.  
  13. vox_offs_tree_table equ 4
  14. vox_offs_data equ 12
  15. txt_buf rb 8
  16. include '../trunk/vox_rotate.inc'
  17.  
  18. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  19. if lang eq ru
  20. caption db '‘®§¤ â¥«ì ¢®ªá¥«¥© 04.05.20',0 ;¯®¤¯¨áì ®ª­ 
  21. else
  22. caption db 'Voxel creator 04.05.20',0
  23. end if
  24.  
  25. BUF_STRUCT_SIZE equ 21
  26. buf2d_data equ dword[edi] ;¤ ­­ë¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
  27. buf2d_w equ dword[edi+8] ;è¨à¨­  ¡ãä¥à 
  28. buf2d_h equ dword[edi+12] ;¢ëá®â  ¡ãä¥à 
  29. buf2d_l equ word[edi+4]
  30. buf2d_t equ word[edi+6] ;®âáâ㯠ᢥàåã
  31. buf2d_size_lt equ dword[edi+4] ;®âáâ㯠᫥¢  ¨ á¯à ¢  ¤«ï ¡ãä¥à 
  32. buf2d_color equ dword[edi+16] ;梥â ä®­  ¡ãä¥à 
  33. buf2d_bits equ byte[edi+20] ;ª®«¨ç¥á⢮ ¡¨â ¢ 1-© â®çª¥ ¨§®¡à ¦¥­¨ï
  34.  
  35. run_file_70 FileInfoBlock
  36. vox_obj_size dd 0 ;à §¬¥à ¢®ªá¥«ì­®£® ®¡ê¥ªâ  (¤«ï ã᪮७¨ï ¢áâ ¢ª¨)
  37. txt_space db ' ',0
  38. if lang eq ru
  39. txt_pref db ' ¡ ',0,' Š¡',0,' Œ¡',0,' ƒ¡',0 ;¯à¨áâ ¢ª¨: ª¨«®, ¬¥£ , £¨£ 
  40. txt_f_size: db ' §¬¥à: '
  41. else
  42. txt_pref db ' b ',0,' Kb',0,' Mb',0,' Gb',0 ;¯à¨áâ ¢ª¨: ª¨«®, ¬¥£ , £¨£ 
  43. txt_f_size: db 'Size: '
  44. end if
  45. .size: rb 16
  46.  
  47. IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
  48. image_data_toolbar dd 0
  49.  
  50. max_open_file_size equ 1024*1024 ;1 Mb
  51.  
  52. align 4
  53. start:
  54.         load_libraries l_libs_start,l_libs_end
  55.         ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
  56.         mov     ebp,lib_0
  57.         cmp     dword [ebp+ll_struc_size-4],0
  58.         jz      @f
  59.                 mcall SF_TERMINATE_PROCESS
  60.         @@:
  61.         mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
  62.         mcall SF_SET_EVENTS_MASK,0x27
  63.         stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
  64.  
  65.         stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
  66.         stdcall [buf2d_create], buf_0z
  67.         stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
  68.  
  69.         include_image_file 'toolbar.png', image_data_toolbar
  70.  
  71.         stdcall mem.Alloc,max_open_file_size
  72.         mov dword[open_file_vox],eax
  73.         stdcall mem.Alloc,max_open_file_size
  74.         mov dword[open_file_img],eax
  75.  
  76.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  77.         mov [last_time],eax
  78.         ;¯à®¢¥àª  ª®¬ ­¤­®© áâப¨
  79.         cmp dword[openfile_path],0
  80.         je @f
  81.                 call but_open_file_cmd_lin
  82.         @@:
  83.  
  84. align 4
  85. red_win:
  86.         call draw_window
  87.  
  88. align 4
  89. still:
  90.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  91.         mov ebx,[last_time]
  92.         add ebx,10 ;§ ¤¥à¦ª 
  93.         cmp ebx,eax
  94.         jge @f
  95.                 mov ebx,eax
  96.         @@:
  97.         sub ebx,eax
  98.         mcall SF_WAIT_EVENT_TIMEOUT
  99.         cmp eax,0
  100.         je timer_funct
  101.  
  102.         cmp al,1
  103.         jz red_win
  104.         cmp al,2
  105.         jz key
  106.         cmp al,3
  107.         jz button
  108.  
  109.         jmp still
  110.  
  111. align 4
  112. timer_funct:
  113.         cmp byte[calc],0
  114.         je still
  115.  
  116.         pushad
  117.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  118.         mov [last_time],eax
  119.  
  120.         ; ᪨¤ë¢ ¥¬ 㪠§ â¥«¨ ¡ãä¥à®¢ buf_npl_p, buf_npl, buf_npl_n
  121.         mov edi,buf_npl_p
  122.         mov eax,buf2d_data
  123.         mov edi,buf_npl
  124.         mov ebx,buf2d_data
  125.         mov edi,buf_npl_n
  126.         mov ecx,buf2d_data
  127.         ; change buffer data pointers
  128.         mov buf2d_data,eax
  129.         mov edi,buf_npl_p
  130.         mov buf2d_data,ebx
  131.         mov edi,buf_npl
  132.         mov buf2d_data,ecx
  133.  
  134.         mov eax,[n_plane]
  135.         mov ebx,buf2d_w
  136.         dec ebx
  137.  
  138.         cmp ebx,eax
  139.         jg @f
  140.                 stdcall create_obj_from_plane,buf_npl,eax ;ᮧ¤ ¥¬ § ¢¥àè î饥 á¥ç¥­¨¥
  141.                 ;¢ë¢®¤ ª®­¥ç­®£® १ã«ìâ â 
  142.                 call draw_object
  143.                 mov byte[calc],0
  144.                 jmp .end_f
  145.         @@:
  146.  
  147.         inc eax
  148.         stdcall create_plane, buf_npl_n,eax
  149.  
  150.         ; ᮧ¤ ­¨¥ ¢®áª¥«ì­®£® á¥ç¥­¨ï ­  ®á­®¢¥ ¡ãä¥à  buf_npl
  151.         mov edi,buf_npl
  152.         mov edx,[bby_min] ;0
  153.         .cycle_0:
  154.         mov ecx,[btx_min] ;0
  155.         .cycle_1:
  156.                 stdcall [buf2d_get_pixel], edi,ecx,edx
  157.                 cmp eax,buf2d_color
  158.                 je @f
  159.                         mov esi,eax
  160.                         call need_node
  161.                         cmp eax,buf2d_color
  162.                         jne @f ;®âᥨ¢ ¥¬ ¢­ãâ७­¨¥ ¢®ªá¥«¨, ¤«ï ®¯â¨¬¨§ æ¨¨ ¬®¤¥«¨
  163.                         mov eax,ebx
  164.                         sub eax,edx
  165.                         stdcall buf2d_vox_obj_create_node, [open_file_vox],ecx,[n_plane],\
  166.                                 eax,[k_scale],esi
  167.                 @@:
  168.                 inc ecx
  169.                 cmp ecx,ebx
  170.                 jle .cycle_1
  171.                 inc edx
  172.                 cmp edx,ebx
  173.                 jle .cycle_0
  174.  
  175.         stdcall [buf2d_draw], buf_npl
  176.         inc dword[n_plane] ;¯¥à¥¬¥é ¥¬ ¯«®áª®áâì á¥ç¥­¨ï
  177.         call draw_pok
  178.         .end_f:
  179.         popad
  180.         jmp still
  181.  
  182. align 4
  183. proc create_plane, buf_img:dword, n_plane:dword
  184.         pushad
  185.         ; ª®¯¨à㥬 «¨æ¥¢®¥ ¨§®¡à ¦¥­¨¥ ¢ ¡ãä¥à buf_img
  186.         ; bby_min - ¨á¯®«ì§ã¥¬ ¤«ï ®¯â¨¬¨§ æ¨¨ (¥á«¨ ᢥàåã ¨§®¡à ¦¥­¨¥ ¯ãá⮥)
  187.         mov eax,[bby_min]
  188.         mov esi,buf_i2
  189.         mov esi,[esi] ;buf2d_data
  190.         mov edi,[buf_img]
  191.         mov ecx,buf2d_w
  192.         imul eax,ecx
  193.         mov ebx,ecx
  194.         imul ecx,ebx
  195.         sub ecx,eax
  196.         lea ecx,[ecx+ecx*2]
  197.         mov edi,buf2d_data
  198.         lea eax,[eax+eax*2]
  199.         add edi,eax
  200.         add esi,eax
  201.         cld
  202.         rep movsb
  203.  
  204.         mov ecx,ebx
  205.         dec ebx
  206.         mov edi,buf_i0
  207.         .cycle_0:
  208.                 mov eax,ebx
  209.                 sub eax,[n_plane] ;eax - ¯¥à¥¢¥à­ãâ ï ª®®à¤¨­ â  n_plane
  210.                 stdcall [buf2d_get_pixel], edi,ecx,eax ;[n_plane]
  211.                 cmp eax,buf2d_color
  212.                 jne @f
  213.                         ;¢ëç¥àª¨¢ ­¨¥ ¢¥à⨪ «ì­®© «¨­¨¨ ¨§ á¥ç¥­¨ï buf_img
  214.                         stdcall [buf2d_line], [buf_img],ecx,[bby_min],ecx,ebx, buf2d_color
  215.                         jmp .end_1
  216.                 @@:
  217.                         mov edx,[bby_min] ;xor edx,edx
  218.                         mov esi,eax
  219.                         .cycle_1: ;横« ¤«ï ­ «®¦¥­¨ï ¢¥àå­¥© ⥪áâãàë
  220.                         stdcall [buf2d_get_pixel], [buf_img],ecx,edx
  221.                         cmp eax, buf2d_color
  222.                         je .end_0
  223.                                 stdcall [buf2d_set_pixel], [buf_img],ecx,edx, esi ;­ «®¦¥­¨¥ ¢¥àå­¥© ⥪áâãàë
  224.                                 jmp .end_1
  225.                         .end_0:
  226.                         inc edx
  227.                         cmp edx,ebx
  228.                         jle .cycle_1
  229.                 .end_1:
  230.                 loop .cycle_0
  231.  
  232.         ;£®à¨§®­â «ì­ë¥ «¨­¨¨ ­  ®á­®¢¥ ¡®ª®¢®© £à ­¨
  233.         mov ecx,[bby_min]
  234.         mov edi,buf_i1
  235.         .cycle_2:
  236.                 stdcall [buf2d_get_pixel], edi,[n_plane],ecx
  237.                 cmp eax,buf2d_color
  238.                 jne @f
  239.                         ;¢ëç¥àª¨¢ ­¨¥ £®à¨§®­â «ì­®© «¨­¨¨ ¨§ á¥ç¥­¨ï buf_img
  240.                         stdcall [buf2d_line], [buf_img],[btx_min],ecx,[btx_max],ecx, buf2d_color
  241.                         jmp .end_3
  242.                 @@:
  243.                         mov edx,[btx_max] ;ebx
  244.                         mov esi,eax
  245.                         .cycle_3: ;横« ¤«ï ­ «®¦¥­¨ï ¡®ª®¢®© ⥪áâãàë
  246.                         stdcall [buf2d_get_pixel], [buf_img],edx,ecx
  247.                         cmp eax, buf2d_color
  248.                         je .end_2
  249.                                 stdcall [buf2d_set_pixel], [buf_img],edx,ecx, esi ;­ «®¦¥­¨¥ ¡®ª®¢®© ⥪áâãàë
  250.                                 jmp .end_3
  251.                         .end_2:
  252.                         dec edx
  253.                         cmp edx,[btx_min]
  254.                         jge .cycle_3
  255.                 .end_3:
  256.                 inc ecx
  257.                 cmp ecx,ebx
  258.                 jle .cycle_2
  259.         popad
  260.         ret
  261. endp
  262.  
  263. align 4
  264. proc create_obj_from_plane, buf_img:dword, n_plane:dword
  265. pushad
  266.         ; ᮧ¤ ­¨¥ ¢®áª¥«ì­®£® á¥ç¥­¨ï ­  ®á­®¢¥ ¡ãä¥à  buf_img
  267.         mov edi,[buf_img]
  268.         mov ebx,buf2d_w
  269.         dec ebx
  270.         mov edx,[bby_min] ;0
  271.         .cycle_0:
  272.         mov ecx,[btx_min] ;0
  273.         .cycle_1:
  274.                 stdcall [buf2d_get_pixel], edi,ecx,edx
  275.                 cmp eax,buf2d_color
  276.                 je @f
  277.                         mov esi,eax
  278.                         ;call need_node
  279.                         ;cmp eax,buf2d_color
  280.                         ;jne @f ;®âᥨ¢ ¥¬ ¢­ãâ७­¨¥ ¢®ªá¥«¨, ¤«ï ®¯â¨¬¨§ æ¨¨ ¬®¤¥«¨
  281.                         mov eax,ebx
  282.                         sub eax,edx
  283.                         stdcall buf2d_vox_obj_create_node, [open_file_vox],ecx,[n_plane],\
  284.                                 eax,[k_scale],esi
  285.                 @@:
  286.                 inc ecx
  287.                 cmp ecx,ebx
  288.                 jle .cycle_1
  289.                 inc edx
  290.                 cmp edx,ebx
  291.                 jle .cycle_0
  292.         ret
  293. popad
  294. endp
  295.  
  296. ;description:
  297. ; äã­ªæ¨ï ¯à®¢¥àï¥â ­ã¦­® «¨ ®âᥨ¢ âì ¢®ªá¥«ì á ª®®à¤¨­ â ¬¨ [n_plane],ecx,edx
  298. ;input:
  299. ; ebx = max size y - 1
  300. ;output:
  301. ; eax = buf2d_color if node need
  302. align 4
  303. need_node:
  304.         mov eax,buf2d_color
  305.         cmp ecx,[btx_min] ;0
  306.         jle .end_f
  307.         cmp ecx,[btx_max] ;0
  308.         jge .end_f
  309.         cmp edx,[bby_min] ;0
  310.         jle .end_f
  311.         cmp edx,ebx ;max-1
  312.         jge .end_f
  313.                 push ecx edx
  314.                 stdcall [buf2d_get_pixel], buf_npl_p,ecx,edx ;¯à®¢¥àª  ¯à¥¤ë¤ã饣® á¥ç¥­¨ï
  315.                 cmp eax,buf2d_color
  316.                 je @f
  317.                 stdcall [buf2d_get_pixel], buf_npl_n,ecx,edx ;¯à®¢¥àª  ¯®á«¥¤ãî饣® á¥ç¥­¨ï
  318.                 cmp eax,buf2d_color
  319.                 je @f
  320.                 dec ecx
  321.                 stdcall [buf2d_get_pixel], edi,ecx,edx
  322.                 cmp eax,buf2d_color
  323.                 je @f
  324.                 add ecx,2
  325.                 stdcall [buf2d_get_pixel], edi,ecx,edx
  326.                 cmp eax,buf2d_color
  327.                 je @f
  328.                 dec ecx
  329.                 dec edx
  330.                 stdcall [buf2d_get_pixel], edi,ecx,edx
  331.                 cmp eax,buf2d_color
  332.                 je @f
  333.                 add edx,2
  334.                 stdcall [buf2d_get_pixel], edi,ecx,edx
  335.                 ;cmp eax,buf2d_color
  336.                 ;je @f
  337.                 @@:
  338.                 pop edx ecx
  339.         .end_f:
  340.         ret
  341.  
  342. align 4
  343. draw_window:
  344. pushad
  345.         mcall SF_REDRAW,SSF_BEGIN_DRAW
  346.  
  347.         ; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
  348.         mov edx,[sc.work]
  349.         or  edx,(3 shl 24)+0x30000000
  350.         mcall SF_CREATE_WINDOW,(20 shl 16)+410,(20 shl 16)+520,,,caption
  351.  
  352.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  353.         mov esi,[sc.work_button]
  354.         mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3
  355.  
  356.         mov ebx,(30 shl 16)+20
  357.         mov edx,4
  358.         int 0x40
  359.  
  360.         mov ebx,(55 shl 16)+20
  361.         mov edx,5
  362.         int 0x40
  363.  
  364.         mov ebx,(85 shl 16)+20
  365.         mov edx,6
  366.         int 0x40
  367.  
  368.         add ebx,25 shl 16
  369.         mov edx,7
  370.         int 0x40
  371.  
  372.         add ebx,25 shl 16
  373.         mov edx,8
  374.         int 0x40
  375.  
  376.         add ebx,25 shl 16
  377.         mov edx,9
  378.         int 0x40
  379.  
  380.         add ebx,25 shl 16
  381.         mov edx,10
  382.         int 0x40
  383.  
  384.         add ebx,25 shl 16
  385.         mov edx,11
  386.         int 0x40
  387.  
  388.         add ebx,25 shl 16
  389.         mov edx,12
  390.         int 0x40
  391.  
  392.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  393.         mov edx,(7 shl 16)+7 ;icon new
  394.         mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16
  395.  
  396.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  397.         add edx,(25 shl 16) ;icon open
  398.         int 0x40
  399.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  400.         add edx,(25 shl 16) ;icon save
  401.         int 0x40
  402.  
  403.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  404.         add edx,(30 shl 16) ;
  405.         int 0x40
  406.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  407.         add edx,(25 shl 16) ;
  408.         int 0x40
  409.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  410.         add edx,(25 shl 16) ;
  411.         int 0x40
  412.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  413.         add edx,(25 shl 16) ;
  414.         int 0x40
  415.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  416.         add edx,(25 shl 16) ;
  417.         int 0x40
  418.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  419.         add edx,(25 shl 16) ;
  420.         int 0x40
  421.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  422.         add edx,(25 shl 16) ;
  423.         int 0x40
  424.  
  425.         call draw_buffers
  426.         call draw_pok
  427.  
  428.         mcall SF_REDRAW,SSF_END_DRAW
  429. popad
  430.         ret
  431.  
  432. align 4
  433. draw_buffers:
  434.         ; *** à¨á®¢ ­¨¥ ¡ãä¥à  ***
  435.         stdcall [buf2d_draw], buf_0
  436.         stdcall [buf2d_draw], buf_i0
  437.         stdcall [buf2d_draw], buf_i1
  438.         stdcall [buf2d_draw], buf_i2
  439.         ret
  440.  
  441. align 4
  442. draw_pok:
  443.         ;®¡­®¢«¥­¨¥ ¯®¤¯¨á¨ à §¬¥à  ä ©« 
  444.         mov edi,txt_f_size.size
  445.         mov eax,dword[vox_obj_size]
  446.         mov ebx,txt_pref
  447.         .cycle:
  448.                 cmp eax,1024
  449.                 jl @f
  450.                 shr eax,10
  451.                 add ebx,4
  452.                 jmp .cycle
  453.         @@:
  454.  
  455.         stdcall convert_int_to_str, 16
  456.         stdcall str_cat, edi,ebx
  457.         stdcall str_cat, edi,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
  458.  
  459.         ;à¨á®¢ ­¨¥ ⥪áâ 
  460.         mov ecx,[sc.work_text]
  461.         or  ecx,0x80000000 or (1 shl 30)
  462.         mov edi,[sc.work] ;梥â ä®­  ®ª­ 
  463.         mcall SF_DRAW_TEXT,(275 shl 16)+7,,txt_f_size
  464.  
  465.         ret
  466.  
  467. align 4
  468. key:
  469.         mcall SF_GET_KEY
  470.         jmp still
  471.  
  472.  
  473. align 4
  474. button:
  475.         mcall SF_GET_BUTTON
  476.         cmp ah,3
  477.         jne @f
  478.                 call but_new_file
  479.                 jmp still
  480.         @@:
  481.         cmp ah,4
  482.         jne @f
  483.                 call but_open_file ;®âªàë⨥ ¢®ªá¥«ì­®£® ä ©« 
  484.                 jmp still
  485.         @@:
  486.         cmp ah,5
  487.         jne @f
  488.                 call but_save_file
  489.                 jmp still
  490.         @@:
  491.         cmp ah,6
  492.         jne @f
  493.                 call but_1
  494.                 jmp still
  495.         @@:
  496.         cmp ah,7
  497.         jne @f
  498.                 call but_2
  499.                 jmp still
  500.         @@:
  501.         cmp ah,8
  502.         jne @f
  503.                 call but_3
  504.                 jmp still
  505.         @@:
  506.         cmp ah,9
  507.         jne @f
  508.                 stdcall but_run, 0
  509.                 jmp still
  510.         @@:
  511.         cmp ah,10
  512.         jne @f
  513.                 stdcall but_run, 1
  514.                 jmp still
  515.         @@:
  516.         cmp ah,11
  517.         jne @f
  518.                 call but_stop
  519.                 jmp still
  520.         @@:
  521.         cmp ah,12
  522.         jne @f
  523.                 call but_rot_z
  524.                 jmp still
  525.         @@:
  526.         cmp ah,1
  527.         jne still
  528. .exit:
  529.         stdcall [buf2d_delete],buf_0
  530.         stdcall [buf2d_delete],buf_0z
  531.         stdcall [buf2d_vox_brush_delete],buf_vox
  532.         stdcall [buf2d_delete],buf_i0
  533.         stdcall [buf2d_delete],buf_i1
  534.         stdcall [buf2d_delete],buf_i2
  535.         stdcall [buf2d_delete],buf_npl_p
  536.         stdcall [buf2d_delete],buf_npl
  537.         stdcall [buf2d_delete],buf_npl_n
  538.         stdcall mem.Free,[image_data_toolbar]
  539.         stdcall mem.Free,[open_file_vox]
  540.         stdcall mem.Free,[open_file_img]
  541.         mcall SF_TERMINATE_PROCESS
  542.  
  543.  
  544. align 4
  545. vox_new_data:
  546.         db 2,0,0,0
  547.         db 000b,001b,010b,011b, 100b,101b,110b,111b ;default table
  548.         dd 0 ;null node
  549.  
  550. align 4
  551. proc but_new_file uses ecx edi esi
  552.         mov ecx,vox_offs_data+4
  553.         mov [vox_obj_size],ecx
  554.         mov esi,vox_new_data
  555.         mov edi,[open_file_vox]
  556.         cld
  557.         rep movsb
  558.         ret
  559. endp
  560.  
  561. align 4
  562. open_file_vox dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  563. open_file_img dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ⥪áâãà
  564.  
  565. align 4
  566. but_open_file:
  567.         pushad
  568.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  569.         mov [OpenDialog_data.type],0
  570.         stdcall [OpenDialog_Start],OpenDialog_data
  571.         cmp [OpenDialog_data.status],2
  572.         je @f
  573.                 ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  574.                 call but_open_file_cmd_lin
  575.         @@:
  576. popad
  577.         ret
  578.  
  579. align 4
  580. but_open_file_cmd_lin:
  581. pushad
  582.         mov [run_file_70.Function], SSF_READ_FILE
  583.         mov [run_file_70.Position], 0
  584.         mov [run_file_70.Flags], 0
  585.         mov [run_file_70.Count], dword max_open_file_size
  586.         m2m [run_file_70.Buffer],dword[open_file_vox]
  587.         mov byte[run_file_70+20], 0
  588.         mov dword[run_file_70.FileName], openfile_path
  589.         mcall SF_FILE,run_file_70
  590.         cmp ebx,0xffffffff
  591.         je .end_open_file
  592.                 ; ¯à®¢¥àª  ­  ¯à ¢¨«ì­®áâì ¢®ªá¥«ì­®£® ä®à¬ â 
  593.                 mov edi,[open_file_vox]
  594.                 add edi,vox_offs_tree_table
  595.                 xor bx,bx
  596.                 mov ecx,8
  597.                 cld
  598.                 @@:
  599.                         movzx ax,byte[edi]
  600.                         add bx,ax
  601.                         inc edi
  602.                         loop @b
  603.                 cmp bx,28 ;28=0+1+2+...+7
  604.                 jne .err_open
  605.  
  606.                 mcall SF_SET_CAPTION,1,openfile_path
  607.                 stdcall buf2d_vox_obj_get_size,[open_file_vox]
  608.                 mov [vox_obj_size],eax
  609.                 call draw_object
  610.                
  611.                 jmp .end_open_file
  612.         .err_open:
  613.                 call but_new_file
  614.                 stdcall [mb_create],msgbox_4,thread
  615.         .end_open_file:
  616.         popad
  617.         ret
  618.  
  619. align 4
  620. but_save_file:
  621.         pushad
  622.                 copy_path open_dialog_name,communication_area_default_path,file_name,0
  623.                 mov [OpenDialog_data.type],1
  624.                 stdcall [OpenDialog_Start],OpenDialog_data
  625.                 cmp [OpenDialog_data.status],2
  626.                 je .end_save_file
  627.                 ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  628.  
  629.                 mov eax,6 ;dword[v_zoom] ;§ ¤ ¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  630.                 mov ebx,[open_file_vox]
  631.                 mov byte[ebx],al
  632.  
  633.                 stdcall buf2d_vox_obj_get_size, ebx
  634.                 mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
  635.                 mov [run_file_70.Function], SSF_CREATE_FILE
  636.                 mov [run_file_70.Position], 0
  637.                 mov [run_file_70.Flags], 0
  638.                 mov ebx, dword[open_file_vox]
  639.                 mov [run_file_70.Buffer], ebx
  640.                 mov byte[run_file_70+20], 0
  641.                 mov dword[run_file_70.FileName], openfile_path
  642.                 mcall SF_FILE,run_file_70
  643.                 cmp ebx,0xffffffff
  644.                 je .end_save_file
  645.  
  646.                 .end_save_file:
  647.         popad
  648.         ret
  649.  
  650. align 4
  651. but_1:
  652.         stdcall open_image_in_buf, buf_i0
  653.         ret
  654.  
  655. align 4
  656. but_2:
  657.         stdcall open_image_in_buf, buf_i1
  658.         call set_buf_tabs
  659.         ret
  660.  
  661. align 4
  662. but_3:
  663.         stdcall open_image_in_buf, buf_i2
  664.         call set_buf_tabs
  665.         ret
  666.  
  667. ;description:
  668. ; ¢ § ¢¨á¨¬®á⨠®â è¨à¨­ë 1-£® ¡ãä¥à  ãáâ ­ ¢«¨¢ ¥¬ ®âáâã¯ë ¤«ï 2-£® ¨ 3-£® ¡ãä¥à®¢
  669. align 4
  670. set_buf_tabs:
  671. push eax ebx edi
  672.         mov edi,buf_i0
  673.         cmp buf2d_data,0
  674.         je @f
  675.                 movzx eax,buf2d_l
  676.                 mov ebx,buf2d_w
  677.                 cmp ebx,128
  678.                 jle .end_0
  679.                         mov ebx,128
  680.                 .end_0:
  681.                 mov edi,buf_i1
  682.                 mov buf2d_l,ax
  683.                 add buf2d_l,bx
  684.                 add buf2d_l,2
  685.                 shl ebx,1
  686.                 mov edi,buf_i2
  687.                 mov buf2d_l,ax
  688.                 add buf2d_l,bx
  689.                 add buf2d_l,4
  690.         @@:    
  691. pop edi ebx eax
  692.         ret
  693.  
  694. align 4
  695. get_scale:
  696. push eax edi
  697.         mov edi,buf_i0
  698.         mov eax,buf2d_w
  699.  
  700.         mov dword[k_scale],-1
  701.         .cycle_s:
  702.         cmp eax,0
  703.         je @f
  704.                 shr eax,1
  705.                 inc dword[k_scale]
  706.                 jmp .cycle_s
  707.         @@:
  708. pop edi eax
  709.         ret
  710.  
  711. align 4
  712. proc set_borders uses eax ebx ecx edx edi
  713.         mov ecx,dword[k_scale]
  714.         mov edx,1
  715.         shl edx,cl
  716.  
  717.         ;®¯à¥¤¥«ï¥¬ ¬¨­¨¬ «ì­ãî ª®®à¤¨­ âã y ­  «¨æ¥¢®© £à ­¨
  718.         mov edi,buf_i2
  719.         mov dword[bby_min],0
  720.         xor ecx,ecx
  721.         .cycle_0:
  722.         xor ebx,ebx
  723.         .cycle_1:
  724.                 stdcall [buf2d_get_pixel],edi,ebx,ecx
  725.                 cmp eax,buf2d_color
  726.                 jne @f
  727.                 inc ebx
  728.                 cmp ebx,edx
  729.                 jl .cycle_1
  730.                 inc dword[bby_min]
  731.                 inc ecx
  732.                 cmp ecx,edx
  733.                 jl .cycle_0
  734.         @@:
  735.  
  736.         ;®¯à¥¤¥«ï¥¬ ¬¨­¨¬ «ì­ãî ª®®à¤¨­ âã x ­  «¨æ¥¢®© £à ­¨
  737.         mov dword[btx_min],0
  738.         xor ebx,ebx
  739.         .cycle_2:
  740.         mov ecx,[bby_min]
  741.         .cycle_3:
  742.                 stdcall [buf2d_get_pixel],edi,ebx,ecx
  743.                 cmp eax,buf2d_color
  744.                 jne @f
  745.                 inc ecx
  746.                 cmp ecx,edx
  747.                 jl .cycle_3
  748.                 inc dword[btx_min]
  749.                 inc ebx
  750.                 cmp ebx,edx
  751.                 jl .cycle_2
  752.         @@:
  753.  
  754.         ;®¯à¥¤¥«ï¥¬ ¬ ªá¨¬ «ì­ãî ª®®à¤¨­ âã x ­  «¨æ¥¢®© £à ­¨
  755.         mov [btx_max],edx
  756.         dec dword[btx_max]
  757.         mov ebx,[btx_max]
  758.         .cycle_4:
  759.         mov ecx,[bby_min]
  760.         .cycle_5:
  761.                 stdcall [buf2d_get_pixel],edi,ebx,ecx
  762.                 cmp eax,buf2d_color
  763.                 jne @f
  764.                 inc ecx
  765.                 cmp ecx,edx
  766.                 jl .cycle_5
  767.                 dec dword[btx_max]
  768.                 dec ebx
  769.                 cmp ebx,[btx_min]
  770.                 jg .cycle_4
  771.         @@:
  772.        
  773.         ;stdcall [buf2d_line], edi, 0,[bby_min],50,[bby_min],255
  774.         ret
  775. endp
  776.  
  777. align 4
  778. btx_min dd 0 ;¡ãä¥à ¢¥àå­¨© ¬¨­. x
  779. btx_max dd 0
  780. bty_min dd 0 ;¡ãä¥à ¢¥àå­¨© ¬¨­. y
  781. bty_max dd 0
  782. ;bbx_min dd 0
  783. ;bbx_max dd 0
  784. bby_min dd 0 ;¡ãä¥à ¡®ª®¢®© ¬¨­. y
  785. bby_max dd 0
  786. k_scale dd 0
  787. n_plane dd 0
  788.  
  789. calc db 0 ;¥á«¨ =1, â® ¨¤¥â ᮧ¤ ­¨¥ ®¡ê¥ªâ 
  790.  
  791. ; ᮧ¤ ­¨¥ ¢®ªá¥«ï ¢ 3 íâ ¯ :
  792. ; 1) ¨é¥¬ ¬¥áâ® ¢ áâàãªâãॠ¤¥à¥¢ , ªã¤  ­ ¤® ¢áâ ¢¨âì (¥á«¨ ¢¥â¢ì áãé¥áâ¢ã¥â, 2-© íâ ¯ ¯à®¯ã᪠¥¬)
  793. ; 2) ¢áâ ¢«ï¥¬ ­®¢ãî ¢¥â¢ì á ¢®ªá¥«¥¬ (3-© íâ ¯ 㦥 ­¥ ¤¥« ¥¬)
  794. ; 3) ¬¥­ï¥¬ 梥⠢®ªá¥«ï
  795. align 4
  796. proc buf2d_vox_obj_create_node, v_obj:dword,coord_x:dword,coord_y:dword,\
  797. coord_z:dword,k_scale:dword,color:dword
  798. pushad
  799. locals
  800.         p_node dd 0 ;த¨â¥«ì᪨© 㧥«
  801. endl
  802.  
  803.         mov edi,[v_obj]
  804.         add edi,vox_offs_data
  805.         mov esi,[k_scale]
  806.         cmp esi,1
  807.         jl .change
  808.         ; *** (1) ***
  809.         .found:
  810.         stdcall vox_obj_get_node_position, [v_obj],[coord_x],[coord_y],[coord_z],esi
  811.         movzx bx,byte[edi+3]
  812.         mov [p_node],edi
  813.         add edi,4
  814.  
  815.         cmp eax,0
  816.         je .end_1
  817.         mov ecx,eax
  818.         cld
  819.         @@: ;横« ¤«ï ¯à®¯ã᪠ ¯à¥¤ë¤ãé¨å ¯®¤¤¥à¥¢ì¥¢ ¢ 㧫¥
  820.                 bt bx,0 ;¯à®¢¥à塞 ¥áâì «¨ ¤®ç¥à­¨¥ 㧫ë
  821.                 jnc .end_0
  822.                         xor eax,eax
  823.                         stdcall vox_obj_rec0 ;¢ eax ¢ëç¨á«ï¥âáï ç¨á«® ¤®ç¥à­¨å 㧫®¢, ¢ ¤ ­­®© ¢¥â¢¨
  824.                 .end_0:
  825.                 shr bx,1
  826.                 loop @b
  827.         .end_1:
  828.         bt bx,0
  829.         jnc .creat ;¥á«¨ ¯®¤¤¥à¥¢  ­¥ áãé¥áâ¢ã¥â, ¯¥à¥å®¤¨¬ ª ᮧ¤ ­¨î
  830.         dec esi
  831.         cmp esi,0
  832.         jg .found
  833.         jmp .change
  834.  
  835.         ; *** (2) ***
  836.         .creat:
  837.         mov edx,[color] ;¬¥­ï¥¬ 梥â
  838.         and edx,0xffffff ;¤«ï ¯à®ä¨« ªâ¨ª¨
  839.         mov ecx,esi
  840.         stdcall vox_obj_add_nodes_mem, [v_obj],edi,ecx ;à áè¨à塞 ¬¥áâ® § ­¨¬ ¥¬®¥ ®¡ê¥ªâ®¬, ¤«ï ¤®¡ ¢«¥­¨ï ­®¢ëå 㧫®¢
  841.         mov ebx,[p_node]
  842.         cld
  843.         @@:
  844.                 mov dword[edi],edx
  845.                 stdcall vox_obj_get_node_bit_mask, [v_obj],[coord_x],[coord_y],[coord_z],esi
  846.                 or byte[ebx+3],al
  847.  
  848.                 mov ebx,edi
  849.                 add edi,4
  850.                 dec esi
  851.                 loop @b
  852.         jmp .end_2
  853.  
  854.         ; *** (3) ***
  855.         .change:
  856.         mov eax,[color] ;¬¥­ï¥¬ 梥â
  857.         mov word[edi],ax
  858.         shr eax,16
  859.         mov byte[edi+2],al
  860.  
  861.         .end_2:
  862. popad
  863.         ret
  864. endp
  865.  
  866. ; ᤢ¨£ ¥â ã§«ë ¤«ï ¤®¡ ¢«¥­¨ï ­®¢ëå 㧫®¢
  867. ;input:
  868. ; p_insert - ¯®§¨æ¨ï ¤«ï ¢áâ ¢ª¨
  869. ; count - ª®««¨ç¥á⢮ ¢áâ ¢«ï¥¬ëå 㧫®¢
  870. align 4
  871. proc vox_obj_add_nodes_mem uses eax ecx edi esi, v_obj:dword,p_insert:dword,count:dword
  872.         mov esi,[v_obj]
  873.         ;stdcall buf2d_vox_obj_get_size,esi
  874.         add esi,[vox_obj_size] ;esi - 㪠§ â¥«ì ­  ª®­¥æ ä ©« 
  875.         mov edi,[count]
  876.         shl edi,2
  877.         add [vox_obj_size],edi
  878.         add edi,esi ;edi - 㪠§ â¥«ì ­  ¡ã¤ã騩 ª®­¥æ ä ©« 
  879.         mov ecx,esi
  880.         sub ecx,[p_insert]
  881.         shr ecx,2 ;ecx - ç¨á«® 横«®¢ ¤«ï ª®¯¨à®¢ ­¨ï
  882.         sub esi,4 ;esi - 㪠§ â¥«ì ­  ¯®á«¥¤­¨© 㧥«
  883.         sub edi,4 ;edi - 㪠§ â¥«ì ­  ¡ã¤ã騩 ¯®á«¥¤­¨© 㧥«
  884.         std
  885.         rep movsd ;ᤢ¨£ ¥¬ ¯ ¬ïâì
  886.         ret
  887. endp
  888.  
  889. ;???
  890. ; ®¯à¥¤¥«¥­¨¥ ¯®§¨æ¨¨ 㧫  ¢ ¤¥à¥¢¥ (®â 0 ¤® 7)
  891. align 4
  892. proc vox_obj_get_node_position uses ebx ecx edi, v_obj:dword,\
  893. coord_x:dword,coord_y:dword,coord_z:dword,k_scale:dword
  894.         mov ecx,[k_scale]
  895.         dec ecx
  896.         mov eax,[coord_x]
  897.         mov ebx,[coord_y]
  898.         mov edi,[coord_z]
  899.         cmp ecx,1
  900.         jl .end_0
  901.                 shr eax,cl
  902.                 shr ebx,cl
  903.                 shr edi,cl
  904.         .end_0:
  905.         and eax,1
  906.         bt ebx,0
  907.         jnc @f
  908.                 bts eax,1
  909.         @@:
  910.         bt edi,0
  911.         jnc @f
  912.                 bts eax,2
  913.         @@:
  914.  
  915.         mov edi,[v_obj]
  916.         add edi,vox_offs_tree_table
  917.         @@:
  918.                 cmp al,byte[edi]
  919.                 je @f
  920.                 inc edi
  921.                 jmp @b
  922.         @@:
  923.         sub edi,[v_obj]
  924.         sub edi,vox_offs_tree_table
  925.         mov eax,edi
  926.        
  927.         ret
  928. endp
  929.  
  930. ;???
  931. ;input:
  932. ; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
  933. ;output:
  934. ; eax - eax + ç¨á«® 㧫®¢ ¢ ¤ ­­ëå ¢®ªá. ®¡ê¥ªâ 
  935. ; edi - 㪠§ â¥«ì ­  ᬥ饭­ë¥ ¤ ­­ë¥ ¢®ªá. ®¡ê¥ªâ 
  936. align 4
  937. proc vox_obj_rec0
  938.         inc eax
  939.         cmp byte[edi+3],0 ;ᬮâਬ ¥áâì «¨ ¯®¤¤¥à¥¢ìï
  940.         je .sub_trees
  941.  
  942.                 ;४ãàᨢ­ë© ¯¥à¥¡®à ¯®¤¤¥à¥¢ì¥¢
  943.                 push ebx ecx
  944.                 mov bh,byte[edi+3]
  945.                 add edi,4
  946.                 mov bl,8
  947.                 .cycle:
  948.                         bt bx,8 ;â¥áâ¨à㥬 ⮫쪮 bh
  949.                         jnc .c_next
  950.                                 stdcall vox_obj_rec0
  951.                         .c_next:
  952.                         shr bh,1
  953.                         dec bl
  954.                         jnz .cycle
  955.                 pop ecx ebx
  956.  
  957.                 jmp .end_f
  958.         .sub_trees:
  959.                 add edi,4
  960.         .end_f:
  961.         ret
  962. endp
  963.  
  964. ;output:
  965. ; eax - 1,2,4,8,16, ... ,128
  966. align 4
  967. proc vox_obj_get_node_bit_mask uses ebx ecx edi, v_obj:dword,\
  968. coord_x:dword,coord_y:dword,coord_z:dword,k_scale:dword
  969.         mov ecx,[k_scale]
  970.         dec ecx
  971.         mov eax,[coord_x]
  972.         mov ebx,[coord_y]
  973.         mov edi,[coord_z]
  974.         cmp ecx,1
  975.         jl .end_0
  976.                 shr eax,cl
  977.                 shr ebx,cl
  978.                 shr edi,cl
  979.         .end_0:
  980.         and eax,1
  981.         bt ebx,0
  982.         jnc @f
  983.                 bts eax,1
  984.         @@:
  985.         bt edi,0
  986.         jnc @f
  987.                 bts eax,2
  988.         @@:
  989.  
  990.         mov ecx,[v_obj]
  991.         add ecx,vox_offs_tree_table
  992.         @@:
  993.                 cmp al,byte[ecx]
  994.                 je @f
  995.                 inc ecx
  996.                 jmp @b
  997.         @@:
  998.         mov eax,1 ;ãáâ ­ ¢«¨¢ ¥¬ ¯¥à¢®­ ç «ì­®¥ §­ ç¥­¨¥ ¡¨â 
  999.         sub ecx,[v_obj]
  1000.         sub ecx,vox_offs_tree_table
  1001.         jz @f
  1002.                 shl eax,cl ;ᤢ¨£ ¥¬ ¡¨â
  1003.         @@:
  1004.        
  1005.         ret
  1006. endp
  1007.  
  1008. ;output:
  1009. ; eax - à §¬¥à ¢ ¡ ©â å § ­¨¬ ¥¬ë© ®¡ê¥ªâ®¬ v_obj
  1010. align 4
  1011. proc buf2d_vox_obj_get_size uses edi, v_obj:dword
  1012.         mov edi,[v_obj]
  1013.         add edi,vox_offs_data
  1014.         xor eax,eax
  1015.         stdcall vox_obj_rec0 ;eax - ç¨á«® 㧫®¢ ¢ ®¡ê¥ªâ¥ v_obj
  1016.         shl eax,2
  1017.         add eax,vox_offs_data
  1018.         ret
  1019. endp
  1020.  
  1021. ;input:
  1022. ; mode_add - ¥á«¨ ­¥ à ¢­® 0 ⮣¤  ᮧ¤ ­¨¥ ¢ ०¨¬¥ ¤®¡ ¢«¥­¨ï ¢®ªá¥«¥©
  1023. align 4
  1024. proc but_run uses eax ebx edi, mode_add:dword
  1025.         ; ¯à®¢¥àª  à §¬¥à®¢ ¨§®¡à ¦¥­¨© (⥪áâãà)
  1026.         mov edi,buf_i0
  1027.         mov ebx,buf2d_h
  1028.         cmp ebx,2
  1029.         jle .err_size_t
  1030.         cmp buf2d_w,ebx
  1031.         jne .err_size_t
  1032.         ;
  1033.         mov edi,buf_i1
  1034.         cmp ebx,buf2d_h
  1035.         jne .err_size_tb
  1036.         mov ebx,buf2d_h
  1037.         cmp ebx,2
  1038.         jle .err_size_b
  1039.         cmp buf2d_w,ebx
  1040.         jne .err_size_b
  1041.  
  1042.                 cmp dword[vox_obj_size],vox_offs_data
  1043.                 jl .n_file ;¥á«¨ à ­ìè¥ ­¥ ¡ë«® ®âªàëâëå ä ©«®¢
  1044.                 cmp dword[mode_add],0
  1045.                 jne @f
  1046.                 .n_file:
  1047.                         call but_new_file
  1048.                 @@:
  1049.  
  1050.                 mov edi,buf_i0
  1051.                 mov eax,buf2d_w
  1052.                 mov edi,buf_npl
  1053.                 cmp buf2d_data,0
  1054.                 jne @f
  1055.                         ; *** ᮧ¤ ¥¬ ¡ãä¥à 
  1056.                         m2m buf2d_w,eax
  1057.                         m2m buf2d_h,eax
  1058.                         stdcall [buf2d_create],edi
  1059.                         mov edi,buf_npl_p
  1060.                         m2m buf2d_w,eax
  1061.                         m2m buf2d_h,eax
  1062.                         stdcall [buf2d_create],edi
  1063.                         mov edi,buf_npl_n
  1064.                         m2m buf2d_w,eax
  1065.                         m2m buf2d_h,eax
  1066.                         stdcall [buf2d_create],edi
  1067.                         jmp .end_0
  1068.                 @@:
  1069.                         ; *** ¨§¬¥­ï¥¬ à §¬¥àë ¡ãä¥à®¢
  1070.                         stdcall [buf2d_resize], edi, eax,eax,1
  1071.                         mov edi,buf_npl_p
  1072.                         stdcall [buf2d_resize], edi, eax,eax,1
  1073.                         mov edi,buf_npl_n
  1074.                         stdcall [buf2d_resize], edi, eax,eax,1
  1075.                 .end_0:
  1076.                 mov dword[n_plane],1
  1077.                 mov byte[calc],1
  1078.                 call get_scale
  1079.                 call set_borders
  1080.  
  1081.                 stdcall create_plane,buf_npl,0
  1082.                 stdcall create_plane,buf_npl_n,1
  1083.                 stdcall create_obj_from_plane,buf_npl,0 ;ᮧ¤ ¥¬ ­ ç «ì­®¥ á¥ç¥­¨¥
  1084.  
  1085.                 jmp @f
  1086.         .err_size_t:
  1087.                 stdcall [mb_create],msgbox_0,thread
  1088.                 jmp @f
  1089.         .err_size_b:
  1090.                 stdcall [mb_create],msgbox_1,thread
  1091.                 jmp @f
  1092.         .err_size_tb:
  1093.                 stdcall [mb_create],msgbox_3,thread
  1094.                 ;jmp @f
  1095.         @@:
  1096.         ret
  1097. endp
  1098.  
  1099. ;¯à¥ªà â¨âì ᮧ¤ ­¨¥ ®¡ê¥ªâ 
  1100. align 4
  1101. but_stop:
  1102.         cmp byte[calc],0
  1103.         je @f
  1104.                 call draw_object
  1105.                 mov byte[calc],0
  1106.         @@:
  1107.         ret
  1108.  
  1109. align 4
  1110. but_rot_z:
  1111.         stdcall vox_obj_rot_z, [open_file_vox]
  1112.         call draw_object
  1113.         ret
  1114.  
  1115. align 4
  1116. draw_object:
  1117.         ;¢ë¢®¤ १ã«ìâ â  ­  íªà ­
  1118.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1119.         stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
  1120.         stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox,\
  1121.                 [open_file_vox], 0,0, 0, 6 ;[k_scale]
  1122.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1123.         ret
  1124.  
  1125. align 4
  1126. proc open_image_in_buf, buf:dword
  1127.         pushad
  1128.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  1129.         mov [OpenDialog_data.type],0
  1130.         stdcall [OpenDialog_Start],OpenDialog_data
  1131.         cmp [OpenDialog_data.status],2
  1132.         je .end_open_file
  1133.  
  1134.         ;stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
  1135.         ;mov [buf],eax
  1136.  
  1137.         mov [run_file_70.Function], SSF_READ_FILE
  1138.         mov [run_file_70.Position], 0
  1139.         mov [run_file_70.Flags], 0
  1140.         mov [run_file_70.Count], dword max_open_file_size
  1141.         m2m [run_file_70.Buffer],dword[open_file_img]
  1142.         mov byte[run_file_70+20], 0
  1143.         mov [run_file_70.FileName], openfile_path
  1144.         mcall SF_FILE,run_file_70
  1145.         cmp ebx,0xffffffff
  1146.         je .end_0
  1147.                 ;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï
  1148.                 stdcall dword[img_decode], dword[open_file_img],ebx,0
  1149.                 or eax,eax
  1150.                 jz .end_0 ;¥á«¨ ­ àã襭 ä®à¬ â ä ©« 
  1151.                 mov ebx,[eax+4] ;+4 = image width
  1152.                 cmp ebx,[eax+8] ;+8 = image height
  1153.                 jne .err_s0
  1154.                 mov ebx,eax
  1155.                 ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
  1156.                 stdcall dword[img_to_rgb2], ebx,dword[open_file_img]
  1157.  
  1158.                 mov edi,[buf]
  1159.                 cmp buf2d_data,0
  1160.                 jne @f
  1161.                         m2m buf2d_w,dword[ebx+4] ;+4 = image width
  1162.                         m2m buf2d_h,dword[ebx+8] ;+8 = image height
  1163.                         stdcall [buf2d_create_f_img], edi,[open_file_img]
  1164.                         jmp .end_1
  1165.                 @@:
  1166.                         mov ecx,[ebx+8]
  1167.                         stdcall [buf2d_resize], edi, [ebx+4],ecx,1 ;¨§¬¥­ï¥¬ à §¬¥àë ¡ãä¥à 
  1168.                         imul ecx,[ebx+4]
  1169.                         lea ecx,[ecx+ecx*2]
  1170.                         mov edi,buf2d_data
  1171.                         mov esi,[open_file_img]
  1172.                         cld
  1173.                         rep movsb ;copy image
  1174.                         jmp .end_1
  1175.                 .err_s0: ;®è¨¡ª , ¨§®¡à ¦¥­¨¥ ¤«ï ¯à¥®¡à §®¢ ­¨ï ­¥ ¯®¤å®¤¨â (­¥ ª¢ ¤à â­®¥)
  1176.                         mov ebx,eax
  1177.                         notify_window_run txt_img_not_square
  1178.                 .end_1:
  1179.                 ;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à ¢ ebx
  1180.                 stdcall dword[img_destroy], ebx
  1181.         .end_0:
  1182.  
  1183.         call draw_buffers
  1184.         .end_open_file:
  1185.         popad
  1186.         ret
  1187. endp
  1188.  
  1189. msgbox_0:
  1190.         db 1,0
  1191.         db '‚­¨¬ ­¨¥',0
  1192.         db ' §¬¥à ¢¥àå­¥£® ¨§®¡à ¦¥­¨ï ­¥ ª®à¥ªâ­ë©',0
  1193.         db '‡ ªàëâì',0
  1194.         db 0
  1195.  
  1196. msgbox_1:
  1197.         db 1,0
  1198.         db '‚­¨¬ ­¨¥',0
  1199.         db ' §¬¥à ¡®ª®¢®£® ¨§®¡à ¦¥­¨ï ­¥ ª®à¥ªâ­ë©',0
  1200.         db '‡ ªàëâì',0
  1201.         db 0
  1202.  
  1203. msgbox_2:
  1204.         db 1,0
  1205.         db '‚­¨¬ ­¨¥',0
  1206.         db ' §¬¥à ¯¥à¥¤­¥£® ¨§®¡à ¦¥­¨ï ­¥ ª®à¥ªâ­ë©',0
  1207.         db '‡ ªàëâì',0
  1208.         db 0
  1209.  
  1210. msgbox_3:
  1211.         db 1,0
  1212.         db '‚­¨¬ ­¨¥',0
  1213.         db ' §¬¥àë ¢¥àå­¥£® ¨ ¡®ª®¢®£® ¨§®¡à ¦¥­¨© ­¥ ᮢ¯ ¤ îâ',13,\
  1214.                 'Žâªà®©â¥ ¨§®¡à ¦¥­¨ï ®¤¨­ ª®¢ëå à §¬¥à®¢',0
  1215.         db '‡ ªàëâì',0
  1216.         db 0
  1217.  
  1218. msgbox_4:
  1219.         db 1,0
  1220.         db '‚­¨¬ ­¨¥',0
  1221.         db 'Žâªà뢠¥¬ë© ä ©« ᮤ¥à¦¨â ­¥ ¢®ªá¥«ì­ë© ä®à¬ â',0
  1222.         db '‡ ªàëâì',0
  1223.         db 0
  1224.  
  1225. txt_img_not_square db '"‚­¨¬ ­¨¥',13,10,'Žâªà뢠¥¬®¥ ¨§®¡à ¦¥­¨¥ ­¥ ª¢ ¤à â­®¥" -tW',0
  1226.  
  1227. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  1228. align 4
  1229. OpenDialog_data:
  1230. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  1231. .procinfo               dd procinfo     ;+4
  1232. .com_area_name          dd communication_area_name      ;+8
  1233. .com_area               dd 0    ;+12
  1234. .opendir_path           dd plugin_path  ;+16
  1235. .dir_default_path       dd default_dir ;+20
  1236. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  1237. .draw_window            dd draw_window  ;+28
  1238. .status                 dd 0    ;+32
  1239. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  1240. .filename_area          dd filename_area        ;+40
  1241. .filter_area            dd Filter
  1242. .x:
  1243. .x_size                 dw 420 ;+48 ; Window X size
  1244. .x_start                dw 10 ;+50 ; Window X position
  1245. .y:
  1246. .y_size                 dw 320 ;+52 ; Window y size
  1247. .y_start                dw 10 ;+54 ; Window Y position
  1248.  
  1249. default_dir db '/rd/1',0
  1250.  
  1251. communication_area_name:
  1252.         db 'FFFFFFFF_open_dialog',0
  1253. open_dialog_name:
  1254.         db 'opendial',0
  1255. communication_area_default_path:
  1256.         db '/rd/1/File managers/',0
  1257.  
  1258. Filter:
  1259. dd Filter.end - Filter ;.1
  1260. .1:
  1261. db 'PNG',0
  1262. db 'JPG',0
  1263. db 'JPEG',0
  1264. db 'BMP',0
  1265. db 'GIF',0
  1266. db 'VOX',0
  1267. .end:
  1268. db 0
  1269.  
  1270.  
  1271.  
  1272. system_dir_0 db '/sys/lib/'
  1273. lib_name_0 db 'proc_lib.obj',0
  1274. system_dir_1 db '/sys/lib/'
  1275. lib_name_1 db 'libimg.obj',0
  1276. system_dir_2 db '/sys/lib/'
  1277. lib_name_2 db 'buf2d.obj',0
  1278. system_dir_3 db '/sys/lib/'
  1279. lib_name_3 db 'msgbox.obj',0
  1280.  
  1281. align 4
  1282. head_f_i:
  1283. if lang eq ru
  1284. head_f_l db '"‘¨á⥬­ ï ®è¨¡ª ',0
  1285. err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,'" -tE',0
  1286. err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,'" -tE',0
  1287. err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,'" -tE',0
  1288. err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,'" -tE',0
  1289. err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,'" -tE',0
  1290. err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,'" -tE',0
  1291. err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'msgbox.obj',39,'" -tE',0
  1292. err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox',39,'" -tE',0
  1293. else
  1294. head_f_l db '"System error',0
  1295. err_message_found_lib_0 db 'Sorry I cannot found library ',39,'proc_lib.obj',39,'" -tE',0
  1296. err_message_import_0 db 'Error on load import library ',39,'proc_lib.obj',39,'" -tE',0
  1297. err_message_found_lib_1 db 'Sorry I cannot found library ',39,'libimg.obj',39,'" -tE',0
  1298. err_message_import_1 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
  1299. err_msg_found_lib_2 db 'Sorry I cannot found library ',39,'buf2d.obj',39,'" -tE',0
  1300. err_msg_import_2 db 'Error on load import library ',39,'buf2d',39,'" -tE',0
  1301. err_msg_found_lib_3 db 'Sorry I cannot found library ',39,'msgbox.obj',39,'" -tE',0
  1302. err_msg_import_3 db 'Error on load import library ',39,'msgbox',39,'" -tE',0
  1303. end if
  1304.  
  1305. align 4
  1306. l_libs_start:
  1307.         lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  1308.                 err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
  1309.         lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  1310.                 err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
  1311.         lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
  1312.                 err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
  1313.         lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
  1314.                 err_msg_found_lib_3,head_f_l,import_msgbox_lib,err_msg_import_3,head_f_i
  1315. l_libs_end:
  1316.  
  1317. align 4
  1318. import_libimg:
  1319.         dd alib_init1
  1320.         img_is_img  dd aimg_is_img
  1321.         img_info    dd aimg_info
  1322.         img_from_file dd aimg_from_file
  1323.         img_to_file dd aimg_to_file
  1324.         img_from_rgb dd aimg_from_rgb
  1325.         img_to_rgb  dd aimg_to_rgb
  1326.         img_to_rgb2 dd aimg_to_rgb2
  1327.         img_decode  dd aimg_decode
  1328.         img_encode  dd aimg_encode
  1329.         img_create  dd aimg_create
  1330.         img_destroy dd aimg_destroy
  1331.         img_destroy_layer dd aimg_destroy_layer
  1332.         img_count   dd aimg_count
  1333.         img_lock_bits dd aimg_lock_bits
  1334.         img_unlock_bits dd aimg_unlock_bits
  1335.         img_flip    dd aimg_flip
  1336.         img_flip_layer dd aimg_flip_layer
  1337.         img_rotate  dd aimg_rotate
  1338.         img_rotate_layer dd aimg_rotate_layer
  1339.         img_draw    dd aimg_draw
  1340.  
  1341.         dd 0,0
  1342.         alib_init1   db 'lib_init',0
  1343.         aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
  1344.         aimg_info    db 'img_info',0
  1345.         aimg_from_file db 'img_from_file',0
  1346.         aimg_to_file db 'img_to_file',0
  1347.         aimg_from_rgb db 'img_from_rgb',0
  1348.         aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
  1349.         aimg_to_rgb2 db 'img_to_rgb2',0
  1350.         aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
  1351.         aimg_encode  db 'img_encode',0
  1352.         aimg_create  db 'img_create',0
  1353.         aimg_destroy db 'img_destroy',0
  1354.         aimg_destroy_layer db 'img_destroy_layer',0
  1355.         aimg_count   db 'img_count',0
  1356.         aimg_lock_bits db 'img_lock_bits',0
  1357.         aimg_unlock_bits db 'img_unlock_bits',0
  1358.         aimg_flip    db 'img_flip',0
  1359.         aimg_flip_layer db 'img_flip_layer',0
  1360.         aimg_rotate  db 'img_rotate',0
  1361.         aimg_rotate_layer db 'img_rotate_layer',0
  1362.         aimg_draw    db 'img_draw',0
  1363.  
  1364. align 4
  1365. proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  1366.         OpenDialog_Init dd aOpenDialog_Init
  1367.         OpenDialog_Start dd aOpenDialog_Start
  1368. dd 0,0
  1369.         aOpenDialog_Init db 'OpenDialog_init',0
  1370.         aOpenDialog_Start db 'OpenDialog_start',0
  1371.  
  1372. align 4
  1373. import_buf2d:
  1374.         init dd sz_init
  1375.         buf2d_create dd sz_buf2d_create
  1376.         buf2d_create_f_img dd sz_buf2d_create_f_img
  1377.         buf2d_clear dd sz_buf2d_clear
  1378.         buf2d_draw dd sz_buf2d_draw
  1379.         buf2d_delete dd sz_buf2d_delete
  1380.         buf2d_resize dd sz_buf2d_resize
  1381.         buf2d_line dd sz_buf2d_line
  1382.         buf2d_rect_by_size dd sz_buf2d_rect_by_size
  1383.         buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
  1384.         buf2d_circle dd sz_buf2d_circle
  1385.         buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
  1386.         buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
  1387.         buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
  1388.         buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
  1389.         buf2d_bit_blt dd sz_buf2d_bit_blt
  1390.         buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
  1391.         buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
  1392.         buf2d_curve_bezier dd sz_buf2d_curve_bezier
  1393.         buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
  1394.         buf2d_draw_text dd sz_buf2d_draw_text
  1395.         buf2d_crop_color dd sz_buf2d_crop_color
  1396.         buf2d_offset_h dd sz_buf2d_offset_h
  1397.         buf2d_flood_fill dd sz_buf2d_flood_fill
  1398.         buf2d_set_pixel dd sz_buf2d_set_pixel
  1399.         buf2d_get_pixel dd sz_buf2d_get_pixel
  1400.         buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
  1401.         buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
  1402.         buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
  1403.         buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
  1404.         buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
  1405.         buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
  1406.         buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
  1407.         buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
  1408.         buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
  1409.         buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
  1410.         dd 0,0
  1411.         sz_init db 'lib_init',0
  1412.         sz_buf2d_create db 'buf2d_create',0
  1413.         sz_buf2d_create_f_img db 'buf2d_create_f_img',0
  1414.         sz_buf2d_clear db 'buf2d_clear',0
  1415.         sz_buf2d_draw db 'buf2d_draw',0
  1416.         sz_buf2d_delete db 'buf2d_delete',0
  1417.         sz_buf2d_resize db 'buf2d_resize',0
  1418.         sz_buf2d_line db 'buf2d_line',0
  1419.         sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
  1420.         sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
  1421.         sz_buf2d_circle db 'buf2d_circle',0
  1422.         sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
  1423.         sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
  1424.         sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
  1425.         sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
  1426.         sz_buf2d_bit_blt db 'buf2d_bit_blt',0
  1427.         sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
  1428.         sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
  1429.         sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
  1430.         sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
  1431.         sz_buf2d_draw_text db 'buf2d_draw_text',0
  1432.         sz_buf2d_crop_color db 'buf2d_crop_color',0
  1433.         sz_buf2d_offset_h db 'buf2d_offset_h',0
  1434.         sz_buf2d_flood_fill db 'buf2d_flood_fill',0
  1435.         sz_buf2d_set_pixel db 'buf2d_set_pixel',0
  1436.         sz_buf2d_get_pixel db 'buf2d_get_pixel',0
  1437.         sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
  1438.         sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
  1439.         sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
  1440.         sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
  1441.         sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
  1442.         sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
  1443.         sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
  1444.         sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
  1445.         sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
  1446.         sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
  1447.  
  1448. align 4
  1449. import_msgbox_lib:
  1450.         mb_create dd amb_create
  1451. ;       mb_reinit dd amb_reinit
  1452. ;       mb_setfunctions dd amb_setfunctions
  1453. dd 0,0
  1454.         amb_create db 'mb_create',0
  1455. ;       amb_reinit db 'mb_reinit',0
  1456. ;       amb_setfunctions db 'mb_setfunctions',0
  1457.  
  1458. mouse_dd dd 0
  1459. sc system_colors
  1460. last_time dd 0
  1461.  
  1462. align 16
  1463. procinfo process_information
  1464.  
  1465. align 4
  1466. buf_0: dd 0
  1467.         dw 5 ;+4 left
  1468.         dw 35 ;+6 top
  1469. .w: dd 6*64 ;+8 w
  1470. .h: dd 7*64 ;+12 h
  1471. .color: dd 0xffffff ;+16 color
  1472.         db 24 ;+20 bit in pixel
  1473.  
  1474. align 4
  1475. buf_0z: dd 0
  1476.         dw 5 ;+4 left
  1477.         dw 35 ;+6 top
  1478. .w: dd 6*64 ;+8 w
  1479. .h: dd 7*64 ;+12 h
  1480. .color: dd 0 ;+16 color
  1481.         db 32 ;+20 bit in pixel
  1482.  
  1483. ;⥪áâãà  1 (¢¥àå­ïï)
  1484. align 4
  1485. buf_i0: dd 0
  1486.         dw 5 ;+4 left
  1487.         dw 35 ;+6 top
  1488. .w: dd 0 ;+8 w
  1489. .h: dd 0 ;+12 h
  1490. .color: dd 0 ;+16 color
  1491.         db 24 ;+20 bit in pixel
  1492.  
  1493. ;⥪áâãà  2
  1494. align 4
  1495. buf_i1: dd 0
  1496.         dw 105 ;+4 left
  1497.         dw 35 ;+6 top
  1498. .w: dd 0 ;+8 w
  1499. .h: dd 0 ;+12 h
  1500. .color: dd 0 ;+16 color
  1501.         db 24 ;+20 bit in pixel
  1502.  
  1503. ;⥪áâãà  3
  1504. align 4
  1505. buf_i2: dd 0
  1506.         dw 205 ;+4 left
  1507.         dw 35 ;+6 top
  1508. .w: dd 0 ;+8 w
  1509. .h: dd 0 ;+12 h
  1510. .color: dd 0 ;+16 color
  1511.         db 24 ;+20 bit in pixel
  1512.  
  1513. ; «£®à¨â¬ ᮧ¤ ­¨ï ¬®¤¥«¨ ¨á¯®«ì§ã¥â 3 á¥ç¥­¨ï:
  1514. ; ¯à¥¤ë¤ã饥, ⥪ã饥, ¯®á«¥¤ãî饥 (íâ® ­¥®¡å®¤¨¬® ¤«ï ®âᥨ¢ ­¨ï ¢®ªá¥«¥© ¢­ãâਠ®¡ê¥ªâ )
  1515.  
  1516. ;¯à¥¤ë¤ã饥 á¥ç¥­¨¥
  1517. align 4
  1518. buf_npl_p: dd 0
  1519.         dw 0 ;+4 left
  1520.         dw 0 ;+6 top
  1521. .w: dd 0 ;+8 w
  1522. .h: dd 0 ;+12 h
  1523. .color: dd 0 ;+16 color
  1524.         db 24 ;+20 bit in pixel
  1525.  
  1526. ;⥪ã饥 á¥ç¥­¨¥
  1527. align 4
  1528. buf_npl: dd 0
  1529.         dw 5 ;+4 left
  1530.         dw 35 ;+6 top
  1531. .w: dd 0 ;+8 w
  1532. .h: dd 0 ;+12 h
  1533. .color: dd 0 ;+16 color
  1534.         db 24 ;+20 bit in pixel
  1535.  
  1536. ;¯®á«¥¤ãî饥 á¥ç¥­¨¥
  1537. align 4
  1538. buf_npl_n: dd 0
  1539.         dw 0 ;+4 left
  1540.         dw 0 ;+6 top
  1541. .w: dd 0 ;+8 w
  1542. .h: dd 0 ;+12 h
  1543. .color: dd 0 ;+16 color
  1544.         db 24 ;+20 bit in pixel
  1545.  
  1546. ;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
  1547. align 4
  1548. vox_6_7_z:
  1549. dd 0,0,1,1,0,0,\
  1550.    0,2,2,2,2,0,\
  1551.    2,2,2,2,2,2,\
  1552.    2,3,2,2,3,2,\
  1553.    2,3,3,3,3,2,\
  1554.    0,3,3,3,3,0,\
  1555.    0,0,3,3,0,0
  1556.  
  1557. align 4
  1558. buf_vox:
  1559.         db 6,7,4,3 ;w,h,h_osn,n
  1560.         rb BUF_STRUCT_SIZE*(2+1)
  1561.  
  1562.  
  1563. align 16
  1564. i_end:
  1565.                 rb 2048
  1566.         thread:
  1567.                 rb 2048
  1568. stacktop:
  1569.         sys_path rb 1024
  1570.         file_name:
  1571.                 rb 1024 ;4096
  1572.         library_path rb 1024
  1573.         plugin_path rb 4096
  1574.         openfile_path rb 4096
  1575.         filename_area rb 256
  1576. mem:
  1577.