Subversion Repositories Kolibri OS

Rev

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

  1. use32
  2.         org 0x0
  3.         db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
  4.         dd 0x1
  5.         dd start
  6.         dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
  7.         dd mem
  8.         dd stacktop
  9.         dd 0
  10.         dd sys_path
  11.  
  12. include '../../../../programs/macros.inc'
  13. include '../../../../programs/proc32.inc'
  14. include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
  15. include '../../../dll.inc'
  16. include 'vox_draw.inc'
  17.  
  18. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  19. caption db 'Voxel editor 16.11.12',0 ;¯®¤¯¨áì ®ª­ 
  20.  
  21. struct FileInfoBlock
  22.         Function dd ?
  23.         Position dd ?
  24.         Flags    dd ?
  25.         Count    dd ?
  26.         Buffer   dd ?
  27.                 db ?
  28.         FileName dd ?
  29. ends
  30.  
  31. run_file_70 FileInfoBlock
  32. image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  33.  
  34. fn_toolbar db 'toolbar.png',0
  35. IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
  36. IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*23
  37. image_data_toolbar dd 0
  38. cursors_count equ 4
  39. IMAGE_CURSORS_SIZE equ 4096*cursors_count ;à §¬¥à ª à⨭ª¨ á ªãàá®à ¬¨
  40.  
  41. ;§­ ç¥­¨ï § ¤ ¢ ¥¬ë¥ ¯® 㬮«ç ­¨î, ¡¥§ ini ä ©« 
  42. ini_def_window_t equ 10
  43. ini_def_window_l equ 10
  44. ini_def_window_w equ 550
  45. ini_def_window_h equ 415
  46. ini_def_buf_w equ 198 ;=192+6
  47. ini_def_buf_h equ 231 ;=224+7
  48. ini_def_s_zoom equ 5
  49. ini_def_t_size equ 10
  50. ini_def_color_b equ 0xffffff
  51. ;®¯¨á ­¨¥ ¯ à ¬ â஢ ¤«ï ini ä ©« 
  52. ini_name db 'vox_editor.ini',0
  53. ini_sec_window db 'Window',0
  54. key_window_t db 't',0
  55. key_window_l db 'l',0
  56. key_window_w db 'w',0
  57. key_window_h db 'h',0
  58. key_buf_w db 'buf_w',0
  59. key_buf_h db 'buf_h',0
  60. ini_sec_options db 'Options',0
  61. key_s_zoom db 's_zoom',0
  62. key_t_size db 'tile_size',0
  63. key_f_size db 'file_size',0
  64. key_col_b db 'c_background',0
  65.  
  66. macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
  67.         ;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
  68.         if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
  69.                 jmp @f
  70.                         local .path_str
  71.                         .path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
  72.                         db 0
  73.                 @@:
  74.                 ;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
  75.                 copy_path .path_str,[32],file_name,0x0
  76.         else
  77.                 copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
  78.         end if
  79.  
  80.         stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
  81.         mov [buf],eax
  82.  
  83.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  84.         mov [run_file_70.Function], 0
  85.         mov [run_file_70.Position], 0
  86.         mov [run_file_70.Flags], 0
  87.         mov [run_file_70.Count], dword size
  88.         m2m [run_file_70.Buffer], [buf]
  89.         mov byte[run_file_70+20], 0
  90.         mov [run_file_70.FileName], file_name
  91.         mov ebx,run_file_70
  92.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  93.         cmp ebx,0xffffffff
  94.         je @f
  95.                 ;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
  96.                 stdcall dword[img_decode], dword[buf],ebx,0
  97.                 mov dword[image_data],eax
  98.                 ;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
  99.                 stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
  100.                 ;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
  101.                 stdcall dword[img_destroy], dword[image_data]
  102.         @@:
  103. }
  104.  
  105. OT_MAP_X  equ  0
  106. OT_MAP_Y  equ  0
  107. OT_CAPT_X_COLOR equ  5 ;®âáâ㯠¤«ï ¯®¤¯¨á¨ 梥â 
  108. OT_CAPT_Y_COLOR equ 30
  109. PEN_MODE_NONE equ -1
  110. PEN_MODE_CLEAR equ 0 ;०¨¬ áâ¨à ­¨ï
  111. PEN_MODE_SELECT_COLOR equ 2 ;०¨¬ ¢ë¡®à  梥â 
  112. PEN_MODE_BRUSH equ 3 ;०¨¬ à ¡®âë á ª¨áâìî
  113.  
  114. align 4
  115. start:
  116.         load_libraries l_libs_start,l_libs_end
  117.         ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
  118.         mov     ebp,lib_2
  119.         cmp     dword [ebp+ll_struc_size-4],0
  120.         jz      @f
  121.                 mcall -1 ;exit not correct
  122.         @@:
  123.         mcall 48,3,sc,sizeof.system_colors
  124.         mcall 40,0x27
  125.         stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
  126.  
  127. ;--- load ini file ---
  128.         copy_path ini_name,sys_path,file_name,0
  129.         ;window startup pozition
  130.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
  131.         mov word[wnd_s_pos+2],ax
  132.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
  133.         mov word[wnd_s_pos],ax
  134.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
  135.         mov word[wnd_s_pos+6],ax
  136.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
  137.         mov word[wnd_s_pos+4],ax
  138.         ;image buffer size
  139.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_w,ini_def_buf_w
  140.         mov [buf_0.w],eax
  141.         mov [buf_0z.w],eax
  142.         add ax,15
  143.         mov [buf_pl.l],ax ;®âáâ㯠¤«ï ¯à ¢®£® ®ª­ 
  144.         stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_h,ini_def_buf_h
  145.         mov [buf_0.h],eax
  146.         mov [buf_0z.h],eax
  147.         ;梥â ä®­ 
  148.         stdcall dword[ini_get_color],file_name,ini_sec_window,key_col_b,ini_def_color_b
  149.         mov [buf_0.color],eax
  150.         mov [buf_pl.color],eax
  151.  
  152.         ;¬ áâ ¡, ¯®á«¥ ª®â®à®£® ¡ã¤¥â 㢥«¨ç¥­¨¥
  153.         stdcall dword[ini_get_int],file_name,ini_sec_options,key_s_zoom,ini_def_s_zoom
  154.         mov [scaled_zoom],eax
  155.         ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á¥ç¥­¨ï
  156.         stdcall dword[ini_get_int],file_name,ini_sec_options,key_t_size,ini_def_t_size
  157.         mov [tile_size],eax
  158.  
  159.         stdcall dword[ini_get_int],file_name,ini_sec_options,key_f_size,64
  160.         shl eax,10
  161.         mov [max_open_file_size],eax
  162.  
  163.         mov ecx,[scaled_zoom]
  164.         xor eax,eax
  165.         inc eax
  166.         shl eax,cl
  167.         imul eax,[tile_size]
  168.         mov [buf_pl.w],eax
  169.         add eax,[tile_size]
  170.         mov [buf_pl.h],eax
  171.  
  172.         ;*** § £à㧪  ªãàá®à®¢
  173.         load_image_file 'cursors_gr.png',image_data_toolbar,IMAGE_CURSORS_SIZE
  174.         stdcall [buf2d_create_f_img], buf_curs_8,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
  175.         stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  176.  
  177.         load_image_file 'cursors.png',image_data_toolbar, IMAGE_CURSORS_SIZE
  178.         stdcall [buf2d_create_f_img], buf_curs,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
  179.         stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
  180.  
  181.         stdcall [buf2d_conv_24_to_8], buf_curs_8,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8¡¨â
  182.         stdcall [buf2d_conv_24_to_32],buf_curs,buf_curs_8 ;¤¥« ¥¬ ¡ãä¥à rgba 32¡¨â
  183.  
  184.  
  185.         stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
  186.         stdcall [buf2d_create], buf_0z ;ᮧ¤ ­¨¥ ¡ãä¥à  £«ã¡¨­ë
  187.         stdcall [buf2d_create], buf_pl ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï á¥ç¥­¨ï
  188.  
  189.         stdcall [buf2d_vox_brush_create], buf_vox_g3, vox_6_7_z
  190.         stdcall [buf2d_vox_brush_create], buf_vox_g2, vox_6_4_z
  191.  
  192.         load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
  193.  
  194.         stdcall mem.Alloc,[max_open_file_size]
  195.         mov dword[open_file_vox],eax
  196.  
  197.         call but_new_file
  198.  
  199.         ;¯¥à¢®­ ç «ì­ ï ãáâ ­®¢ª  ªãàá®à 
  200.         stdcall set_pen_mode,1,0,((9 shl 8)+9) shl 16 ;pen
  201.  
  202. align 4
  203. red_win:
  204.         call draw_window
  205.  
  206. align 4
  207. still:
  208.         mcall 10
  209.  
  210.         cmp al,1
  211.         jz red_win
  212.         cmp al,2
  213.         jz key
  214.         cmp al,3
  215.         jz button
  216.         cmp al,6
  217.         jne @f
  218.                 mcall 9,procinfo,-1
  219.                 cmp ax,word[procinfo+4]
  220.                 jne @f ;®ª­® ­¥  ªâ¨¢­®
  221.                 call mouse
  222.         @@:
  223.         jmp still
  224.  
  225. align 4
  226. mouse:
  227.         pushad
  228.         mcall 37,2
  229.         bt eax,1 ;right button
  230.         jnc @f
  231.                 mcall 37,1 ;get mouse coords
  232.                 mov ebx,eax
  233.                 shr ebx,16
  234.                 and eax,0xffff
  235.                 stdcall get_buf_color, buf_0
  236.                 stdcall get_buf_color, buf_pl
  237.                 jmp .end_f
  238.         @@:
  239.         bt eax,0 ;left button
  240.         jnc .end_f
  241.                 mcall 37,1 ;get mouse coords
  242.                 mov ebx,eax
  243.                 shr ebx,16
  244.                 and eax,0xffff
  245.  
  246.                 cmp dword[v_pen_mode],PEN_MODE_SELECT_COLOR
  247.                 jne .end_2
  248.                         stdcall get_buf_color, buf_0
  249.                         stdcall get_buf_color, buf_pl
  250.                         jmp .end_f
  251.                 .end_2:
  252.  
  253.  
  254.                 push eax ebx
  255.                 mov edx,[v_zoom]
  256.                 cmp edx,[scaled_zoom]
  257.                 jle @f
  258.                 ;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  259.                 sub edx,[scaled_zoom]
  260.                 sub ax,word[buf_0.t]
  261.                 sub bx,word[buf_0.l]
  262.                 stdcall get_mouse_ev_scale, [buf_vox], ebx, eax, [scaled_zoom],edx
  263.                 cmp eax,0
  264.                 je @f
  265.                         mov ebx,eax
  266.                         and eax,0x3fffffff
  267.                         rol ebx,2
  268.                         and ebx,3
  269.                         dec ebx
  270.  
  271.                         shl ebx,2
  272.                         add ebx,cam_x
  273.                         mov dword[ebx],eax ;change [cam_x] or [cam_y] or [cam_z]
  274.                         call draw_objects
  275.  
  276.                         pop ebx eax
  277.                         jmp .end_f
  278.                 @@:
  279.                 pop ebx eax
  280.  
  281.  
  282.                 ;eax - mouse coord y
  283.                 ;ebx - mouse coord x
  284.                 movzx edx,word[buf_pl.t]
  285.                 add edx,OT_MAP_Y
  286.                 cmp eax,edx
  287.                 jl .end_f
  288.                         sub eax,edx
  289.                         xor edx,edx
  290.                         mov ecx,[tile_size] ;H
  291.                         div ecx
  292.                 movzx edx,word[buf_pl.l]
  293.                 add edx,OT_MAP_X
  294.                 cmp ebx,edx
  295.                 jl .end_f
  296.                         call convert_y ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ âë y
  297.                         cmp eax,0
  298.                         jge .end_0 ;®£à ­¨ç¥­¨¥ ¯® ­¨¦­¥© ª®®à¤¨­ â¥ y
  299.                                 cmp eax,-1
  300.                                 jne .end_f
  301.                                 ;¬¥­ï¥¬ á¥ç¥­¨¥, ¯®¯ «¨ ­  ª¢ ¤à â¨ª
  302.                                 sub ebx,edx
  303.                                 mov eax,ebx
  304.                                 xor edx,edx
  305.                                 mov ecx,[tile_size] ;W
  306.                                 div ecx
  307.                                 mov [n_plane],eax
  308.                                 jmp .end_1
  309.                         .end_0:
  310.                         mov [v_cur_y],eax ;Y-coord
  311.                         sub ebx,edx
  312.                         mov eax,ebx
  313.                         xor edx,edx
  314.                         mov ecx,[tile_size] ;W
  315.                         div ecx
  316.                         mov [v_cur_x],eax ;X-coord
  317.  
  318.                         cmp dword[v_pen_mode],PEN_MODE_CLEAR
  319.                         jl .end_1
  320.                         cmp dword[v_pen_mode],1
  321.                         jg .end_1
  322.                                 mov eax,[v_cur_x]
  323.                                 mov ebx,[n_plane]
  324.                                 mov edx,[v_cur_y]
  325.  
  326.                                 mov ecx,[v_zoom]
  327.                                 cmp ecx,[scaled_zoom]
  328.                                 jle .no_c_coord_0
  329.                                         ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
  330.                                         ;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
  331.                                         mov ecx,[scaled_zoom]
  332.  
  333.                                         mov edi,[cam_x]
  334.                                         shl edi,cl
  335.                                         add eax,edi
  336.                                         mov edi,[cam_y]
  337.                                         shl edi,cl
  338.                                         add ebx,edi
  339.                                         mov edi,[cam_z]
  340.                                         shl edi,cl
  341.                                         add edx,edi
  342.                                 .no_c_coord_0:
  343.  
  344.                                 ;®â«¨ç î騩áï ¯ à ¬¥âà ¤«ï ä㭪樨 ᮧ¤ ­¨ï ¢®ªá¥«ï
  345.                                 cmp dword[v_pen_mode],1
  346.                                 jne @f
  347.                                         push dword[v_color]
  348.                                 @@:
  349.  
  350.                                 mov ecx,dword[v_zoom]
  351.                                 mov edi,eax
  352.                                 mov esi,ebx
  353.                                 mcall 66,3
  354.                                 and eax,3 ;3 -> ¡¨â 0 «¥¢ë© Shift ­ ¦ â, ¡¨â 1 ¯à ¢ë© Shift ­ ¦ â
  355.                 jz .shift_end
  356.                     ;¥á«¨ ­ ¦ â Shift, ⮠। ªâ¨à㥬 ­  ¢¥àå­¥¬ ã஢­¥
  357.                     ;¤«ï í⮣® ¢á¥ ª®®à¤¨­ âë ¤¥«¨¬ ­  2   ®â ¬ áâ ¡  ®â­¨¬ ¥¬ 1
  358.                     shr edx,1
  359.                     shr esi,1
  360.                     shr edi,1
  361.                     dec ecx
  362.                 .shift_end:
  363.                
  364.                 ;¢ë§®¢ ®¡é¨å ¯ à ¬¥â஢ ¤«ï ä㭪権
  365.                                 push ecx edx esi edi
  366.                                 push dword[open_file_vox]
  367.  
  368.                                 ;¢ë§®¢ ä㭪権
  369.                                 cmp dword[v_pen_mode],1
  370.                                 jne @f
  371.                                         call buf2d_vox_obj_create_node
  372.                                         ;stdcall buf2d_vox_obj_create_node, [open_file_vox], edi,esi,edx, [v_zoom], [v_color]
  373.                                         jmp .end_1
  374.                                 @@:
  375.                                         call buf2d_vox_obj_delete_node
  376.                                         ;stdcall buf2d_vox_obj_delete_node, [open_file_vox], edi,esi,edx, [v_zoom]
  377.  
  378.                         .end_1:
  379.                         call draw_objects
  380.                         call draw_pok
  381.         .end_f:
  382.         popad
  383.         ret
  384.  
  385. ;input:
  386. ; eax - coord y
  387. ; ebx - coord x
  388. align 4
  389. proc get_buf_color, buf:dword
  390. pushad
  391.         mov edi,[buf]
  392.         cmp ax,buf2d_t
  393.         jl .end_f
  394.         sub ax,buf2d_t
  395.         cmp eax,buf2d_h
  396.         jg .end_f
  397.         cmp bx,buf2d_l
  398.         jl .end_f
  399.         sub bx,buf2d_l
  400.         cmp ebx,buf2d_w
  401.         jg .end_f
  402.                 stdcall [buf2d_get_pixel], edi,ebx,eax
  403.                 mov [v_color],eax
  404.                 call on_change_color ;®â®¡à ¦ ¥¬ ¨§¬¥­¥­¨ï 梥â 
  405.         .end_f:
  406. popad
  407.         ret
  408. endp
  409.  
  410. ;¯à¥®¡à §®¢ë¢ ¥¬ ª®®à¤¨­ âã y (§­ ç¥­¨¥ ¤®«¦­® 㢥«¨ç¨¢ âìáï á ­¨§ã ¢¢¥àå)
  411. align 4
  412. convert_y:
  413.         push ecx edx
  414.         mov ecx,[v_zoom]
  415.         cmp ecx,[scaled_zoom]
  416.         jle @f
  417.                 mov ecx,[scaled_zoom]
  418.         @@:
  419.         mov edx,1
  420.         cmp ecx,1
  421.         jl @f
  422.                 shl edx,cl
  423.         @@:
  424.         sub edx,eax
  425.         dec edx
  426.         mov eax,edx
  427.         pop edx ecx
  428.         ret
  429.  
  430. align 4
  431. draw_window:
  432. pushad
  433.         mcall 12,1
  434.  
  435.         ; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
  436.         mov edx,[sc.work]
  437.         or  edx,(3 shl 24)+0x30000000
  438.         mov edi,caption
  439.         mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4]
  440.  
  441.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  442.         mov eax,8
  443.         mov ebx,(5 shl 16)+20
  444.         mov ecx,(5 shl 16)+20
  445.         mov edx,3
  446.         mov esi,[sc.work_button]
  447.         int 0x40
  448.  
  449.         mov ebx,(30 shl 16)+20
  450.         mov edx,4
  451.         int 0x40
  452.         add ebx,25 shl 16
  453.         mov edx,5
  454.         int 0x40
  455.         add ebx,30 shl 16
  456.         mov edx,6
  457.         int 0x40
  458.         add ebx,25 shl 16
  459.         mov edx,7
  460.         int 0x40
  461.         add ebx,25 shl 16
  462.         mov edx,8
  463.         int 0x40
  464.         add ebx,25 shl 16
  465.         mov edx,9
  466.         int 0x40
  467.         add ebx,25 shl 16
  468.         mov edx,10
  469.         int 0x40
  470.         add ebx,25 shl 16
  471.         mov edx,11
  472.         int 0x40
  473.         add ebx,25 shl 16
  474.         mov edx,12
  475.         int 0x40
  476.         add ebx,25 shl 16
  477.         mov edx,13
  478.         int 0x40
  479.         add ebx,25 shl 16
  480.         mov edx,14
  481.         int 0x40
  482.         add ebx,25 shl 16
  483.         mov edx,15
  484.         int 0x40
  485.         add ebx,25 shl 16
  486.         mov edx,16
  487.         int 0x40
  488.         add ebx,25 shl 16
  489.         mov edx,17
  490.         int 0x40
  491.         add ebx,25 shl 16
  492.         mov edx,18
  493.         int 0x40
  494.         add ebx,25 shl 16
  495.         mov edx,19
  496.         int 0x40
  497.         add ebx,25 shl 16
  498.         mov edx,20
  499.         int 0x40
  500.         add ebx,25 shl 16
  501.         mov edx,21
  502.         int 0x40
  503.         add ebx,25 shl 16
  504.         mov edx,22
  505.         int 0x40
  506.         add ebx,25 shl 16
  507.         mov edx,23
  508.         int 0x40
  509.         add ebx,25 shl 16
  510.         mov edx,24
  511.         int 0x40
  512.         add ebx,25 shl 16
  513.         mov edx,25
  514.         int 0x40
  515.  
  516.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  517.         mov eax,7
  518.         mov ebx,[image_data_toolbar]
  519.         mov ecx,(16 shl 16)+16
  520.         mov edx,(7 shl 16)+7 ;icon new
  521.         int 0x40
  522.  
  523.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  524.         add edx,(25 shl 16) ;icon open
  525.         int 0x40
  526.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  527.         add edx,(25 shl 16) ;icon save
  528.         int 0x40
  529.  
  530.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  531.         add edx,(30 shl 16) ;㢥«¨ç. ¬ áèâ ¡
  532.         int 0x40
  533.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  534.         add edx,(25 shl 16) ;㬥­ìè. ¬ áèâ ¡
  535.         int 0x40
  536.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  537.         add edx,(25 shl 16) ;camera 3g 2g
  538.         int 0x40
  539.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  540.         add edx,(25 shl 16) ;¯®¢®à®â 1
  541.         int 0x40
  542.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  543.         add edx,(25 shl 16) ;¯®¢®à®â 2
  544.         int 0x40
  545.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  546.         add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠+
  547.         int 0x40
  548.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  549.         add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠-
  550.         int 0x40
  551.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  552.         add edx,(25 shl 16) ;¨­áâà㬥­â ª à ­¤ è
  553.         int 0x40
  554.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  555.         add edx,(25 shl 16) ;¨­áâà㬥­â ª¨áâì
  556.         int 0x40
  557.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  558.         add edx,(25 shl 16) ;¨­áâà㬥­â § â¨à çª 
  559.         int 0x40
  560.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  561.         add edx,(25 shl 16) ;¢ë¡®à 梥â 
  562.         int 0x40
  563.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  564.         add edx,(25 shl 16) ;®á¢¥é¥­¨¥
  565.         int 0x40
  566.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  567.         add edx,(25 shl 16) ;७¤¥à 2*2
  568.         int 0x40
  569.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  570.         add edx,(25 shl 16) ;ᮧ¤ âì ª¨áâì
  571.         int 0x40
  572.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  573.         add edx,(25 shl 16) ;­ à¨á®¢ âì ª¨áâì
  574.         int 0x40
  575.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  576.         add edx,(25 shl 16) ;㤠«¨âì ª¨áâì
  577.         int 0x40
  578.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  579.         add edx,(25 shl 16) ;è¨à¨­  ª¨á⨠-1
  580.         int 0x40
  581.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  582.         add edx,(25 shl 16) ;è¨à¨­  ª¨á⨠+1
  583.         int 0x40
  584.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  585.         add edx,(25 shl 16) ;¢ëá®â  ª¨á⨠-1
  586.         int 0x40
  587.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  588.         add edx,(25 shl 16) ;¢ëá®â  ª¨á⨠+1
  589.         int 0x40
  590.  
  591.         ; *** à¨á®¢ ­¨¥ ¡ãä¥à®¢ ***
  592.         call draw_objects
  593.         call draw_pok
  594.  
  595.         mcall 12,2
  596. popad
  597.         ret
  598.  
  599. align 4
  600. draw_pok:
  601.         mov eax,47
  602.         mov ecx,[v_zoom]
  603.         mov ebx,(3 shl 16)+(1 shl 31)
  604.         mov edx,((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2
  605.         mov esi,[sc.work_button_text]
  606.         or  esi,(1 shl 30)
  607.         mov edi,[sc.work_button]
  608.         int 0x40 ;¬ áèâ ¡
  609.         mov ecx,[n_plane]
  610.         add edx,115 shl 16 ;9
  611.         int 0x40 ;­®¬¥à á¥ç¥­¨ï
  612.  
  613.         ;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ªãàá®à 
  614.         mov dword[txt_curor.size],0
  615.         mov eax,dword[v_cur_x]
  616.         mov edi,txt_curor.size
  617.         call convert_int_to_str
  618.         stdcall str_cat, edi,txt_mull
  619.         mov eax,dword[v_cur_y]
  620.         mov edi,txt_buf
  621.         call convert_int_to_str
  622.         stdcall str_cat, txt_curor.size,edi
  623.         stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
  624.  
  625.         ;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ª¨áâ¨
  626.         mov dword[txt_brush.size],0
  627.         mov eax,dword[brush_w]
  628.         mov edi,txt_brush.size
  629.         call convert_int_to_str
  630.         stdcall str_cat, edi,txt_mull
  631.         mov eax,dword[brush_h]
  632.         mov edi,txt_buf
  633.         call convert_int_to_str
  634.         stdcall str_cat, txt_brush.size,edi
  635.         stdcall str_cat, txt_brush.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
  636.  
  637.         mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
  638.         mov ebx,(OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2
  639.         mov ecx,[sc.work_text]
  640.         or  ecx,0x80000000 ;or (1 shl 30)
  641.         mov edx,txt_color
  642.         int 0x40
  643.  
  644.         mov edx,txt_curor
  645.         add ebx,115 shl 16
  646.         or  ecx,(1 shl 30)
  647.         mov edi,[sc.work]
  648.         int 0x40
  649.  
  650.         mov edx,txt_brush
  651.         add ebx,115 shl 16
  652.         int 0x40
  653.  
  654.         mov edx,txt_zoom
  655.         add ebx,115 shl 16
  656.         int 0x40
  657.  
  658.         mov edx,txt_n_plane
  659.         add ebx,115 shl 16
  660.         int 0x40
  661.  
  662.         call on_change_color
  663.         ret
  664.  
  665. align 4
  666. on_change_color:
  667. pushad
  668.         mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
  669.         mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
  670.         mov edx,[v_color]
  671.         mcall 13
  672.  
  673.         mov ebx,(1 shl 8)+(6 shl 16)
  674.         mov ecx,edx
  675.         mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
  676.         mov esi,[sc.work_text]
  677.         add esi,(1 shl 30)
  678.         mov edi,[sc.work]
  679.         mcall 47
  680. popad
  681.         ret
  682.  
  683. align 4
  684. key:
  685.         mcall 2
  686.         jmp still
  687.  
  688.  
  689. align 4
  690. button:
  691.         mcall 17
  692.         cmp ah,3
  693.         jne @f
  694.                 call but_new_file
  695.                 call draw_objects
  696.                 call draw_pok
  697.         @@:
  698.         cmp ah,4
  699.         jne @f
  700.                 call but_open_file
  701.         @@:
  702.         cmp ah,5
  703.         jne @f
  704.                 call but_save_file
  705.         @@:
  706.         cmp ah,6
  707.         jne @f
  708.                 call but_camera_3g_2g
  709.         @@:
  710.         cmp ah,7
  711.         jne @f
  712.                 call but_zoom_p
  713.         @@:
  714.         cmp ah,8
  715.         jne @f
  716.                 call but_zoom_m
  717.         @@:
  718.         cmp ah,9
  719.         jne @f
  720.                 call but_3
  721.         @@:
  722.         cmp ah,10
  723.         jne @f
  724.                 call but_4
  725.         @@:
  726.         cmp ah,11
  727.         jne @f
  728.                 call but_plane_inc
  729.         @@:
  730.         cmp ah,12
  731.         jne @f
  732.                 call but_plane_dec
  733.         @@:
  734.         cmp ah,13
  735.         jne @f
  736.                 call but_mode_pen
  737.         @@:
  738.         cmp ah,14
  739.         jne @f
  740.                 call but_mode_brush
  741.         @@:
  742.         cmp ah,15
  743.         jne @f
  744.                 call but_mode_clear
  745.         @@:
  746.         cmp ah,16
  747.         jne @f
  748.                 stdcall set_pen_mode,PEN_MODE_SELECT_COLOR,3,((9 shl 8)+9) shl 16
  749.                 call draw_palete
  750.         @@:
  751.         cmp ah,17
  752.         jne @f
  753.                 call but_light
  754.         @@:
  755.         cmp ah,18
  756.         jne @f
  757.                 call but_rend_2_2
  758.         @@:
  759.         cmp ah,19
  760.         jne @f
  761.                 call but_brush_copy
  762.         @@:
  763.         cmp ah,20
  764.         jne @f
  765.                 call but_brush_draw
  766.         @@:
  767.         cmp ah,21
  768.         jne @f
  769.                 call but_brush_clear
  770.         @@:
  771.         cmp ah,22
  772.         jne @f
  773.                 call but_bru_w_m
  774.         @@:
  775.         cmp ah,23
  776.         jne @f
  777.                 call but_bru_w_p
  778.         @@:
  779.         cmp ah,24
  780.         jne @f
  781.                 call but_bru_h_m
  782.         @@:
  783.         cmp ah,25
  784.         jne @f
  785.                 call but_bru_h_p
  786.         @@:
  787.         cmp ah,1
  788.         jne still
  789. .exit:
  790.         stdcall [buf2d_delete],buf_0
  791.         stdcall [buf2d_delete],buf_0z
  792.         cmp dword[buf_r_img],0
  793.         je @f
  794.                 stdcall [buf2d_delete],buf_r_img
  795.                 stdcall [buf2d_delete],buf_r_z
  796.         @@:
  797.         stdcall [buf2d_vox_brush_delete], buf_vox_g3
  798.         stdcall [buf2d_vox_brush_delete], buf_vox_g2
  799.         stdcall [buf2d_delete],buf_curs
  800.         stdcall [buf2d_delete],buf_curs_8
  801.         stdcall mem.Free,[image_data_toolbar]
  802.         stdcall mem.Free,[open_file_vox]
  803.         mcall -1
  804.  
  805. ;¤ ­­ë¥ ¤«ï ¨­¨æ¨ «¨§ æ¨¨ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
  806. align 4
  807. vox_new_data:
  808.         db 2,0,0,0
  809.         db 0,1,2,3,4,5,6,7 ;default table
  810.         dd 0 ;null node
  811.  
  812. ;¨­¨æ¨ «¨§ æ¨ï ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
  813. align 4
  814. proc but_new_file uses ecx edi esi
  815.         mov ecx,vox_offs_data+4
  816.         mov esi,vox_new_data
  817.         mov edi,[open_file_vox]
  818.         cld
  819.         rep movsb
  820.         ret
  821. endp
  822.  
  823. align 4
  824. open_file_vox dd 0 ;㪠§ â¥«ì ­  ®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  825.  
  826. align 4
  827. but_open_file:
  828.         pushad
  829.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  830.         mov [OpenDialog_data.type],0
  831.         stdcall [OpenDialog_Start],OpenDialog_data
  832.         cmp [OpenDialog_data.status],2
  833.         je .end_open_file
  834.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  835.  
  836.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  837.         mov [run_file_70.Function], 0
  838.         mov [run_file_70.Position], 0
  839.         mov [run_file_70.Flags], 0
  840.         m2m dword[run_file_70.Count], dword[max_open_file_size]
  841.         m2m [run_file_70.Buffer], [open_file_vox]
  842.         mov byte[run_file_70+20], 0
  843.         mov dword[run_file_70.FileName], openfile_path
  844.         mov ebx,run_file_70
  845.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  846.         cmp ebx,0xffffffff
  847.         je .end_open_file
  848.  
  849.         ;add ebx,[open_file_vox]
  850.         ;mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
  851.         mcall 71,1,openfile_path
  852.  
  853.         ;---
  854.         ;
  855.         mov eax,[open_file_vox]
  856.         movzx eax,byte[eax]
  857.         and eax,0xff ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  858.         mov dword[v_zoom],eax ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  859.         mov dword[cam_x],0
  860.         mov dword[cam_y],0
  861.         mov dword[cam_z],0
  862.         call draw_objects
  863.         .end_open_file:
  864.         popad
  865.         ret
  866.  
  867. align 4
  868. but_save_file:
  869.         pushad
  870.                 copy_path open_dialog_name,communication_area_default_path,file_name,0
  871.                 mov [OpenDialog_data.type],1
  872.                 stdcall [OpenDialog_Start],OpenDialog_data
  873.                 cmp [OpenDialog_data.status],2
  874.                 je .end_save_file
  875.                 ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  876.  
  877.                 mov eax,dword[v_zoom] ;§ ¤ ¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  878.                 mov ebx,[open_file_vox]
  879.                 mov byte[ebx],al
  880.  
  881.                 stdcall buf2d_vox_obj_get_size, ebx
  882.                 mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
  883.                 mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  884.                 mov [run_file_70.Function], 2
  885.                 mov [run_file_70.Position], 0
  886.                 mov [run_file_70.Flags], 0
  887.                 mov ebx, dword[open_file_vox]
  888.                 mov [run_file_70.Buffer], ebx
  889.                 mov byte[run_file_70+20], 0
  890.                 mov dword[run_file_70.FileName], openfile_path
  891.                 mov ebx,run_file_70
  892.                 int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  893.                 cmp ebx,0xffffffff
  894.                 je .end_save_file
  895.  
  896.                 .end_save_file:
  897.         popad
  898.         ret
  899.  
  900. ;ᬥ­  ¢¨¤  ª ¬¥àë ­  ¯à®á¬®âà 3 ¨ 2 £à ­¥©
  901. align 4
  902. but_camera_3g_2g:
  903.         cmp dword[buf_vox],buf_vox_g3
  904.         je @f
  905.                 mov dword[buf_vox],buf_vox_g3
  906.                 jmp .end_0
  907.         @@:
  908.                 mov dword[buf_vox],buf_vox_g2
  909.         .end_0:
  910.         call draw_objects
  911.         ret
  912.  
  913. ;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
  914. align 4
  915. but_zoom_p:
  916.         cmp dword[v_zoom],10 ;¬ ªá¨¬ «ì­ë© à §¬¥à, ¤® ª®â®à®£® ¬®¦­® 㢥«¨ç¨âì 2^10=1024
  917.         jge @f
  918.                 inc dword[v_zoom]
  919.                 shl dword[n_plane],1
  920.                 push eax
  921.                 mov eax,[v_zoom]
  922.                 cmp eax,[scaled_zoom]
  923.                 jl .end_0
  924.                         push ecx
  925.                         mov ecx,[scaled_zoom]
  926.                         xor eax,eax
  927.                         inc eax
  928.                         shl eax,cl
  929.                         shl dword[cam_x],1
  930.                         shl dword[cam_y],1
  931.                         shl dword[cam_z],1
  932.                         cmp eax,[n_plane]
  933.                         jg .end_1
  934.                                 ;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
  935.                                 sub [n_plane],eax
  936.                                 inc dword[cam_y]
  937.                         .end_1:
  938.                         pop ecx
  939.                 .end_0:
  940.                 pop eax
  941.                 call draw_objects
  942.                 call draw_pok
  943.         @@:
  944.         ret
  945.  
  946. ;㬥­ì襭¨¥ ¬ áèâ ¡ 
  947. align 4
  948. but_zoom_m:
  949.         cmp dword[v_zoom],1
  950.         jl @f
  951.                 dec dword[v_zoom]
  952.                 shr dword[n_plane],1
  953.                 push eax
  954.                 mov eax,[v_zoom]
  955.                 cmp eax,[scaled_zoom]
  956.                 jl .end_0
  957.                         shr dword[cam_x],1
  958.                         shr dword[cam_y],1
  959.                         jnc .end_1
  960.                                 ;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
  961.                                 push ecx
  962.                                 mov ecx,[scaled_zoom]
  963.                                 dec ecx
  964.                                 xor eax,eax
  965.                                 inc eax
  966.                                 shl eax,cl
  967.                                 add [n_plane],eax
  968.                                 pop ecx
  969.                         .end_1:
  970.                         shr dword[cam_z],1
  971.                 .end_0:
  972.                 pop eax
  973.                 call draw_objects
  974.                 call draw_pok
  975.         @@:
  976.         ret
  977.  
  978. align 4
  979. but_3:
  980.         stdcall vox_obj_rot_z, [open_file_vox]
  981.         call draw_objects
  982.         ret
  983.  
  984. align 4
  985. but_4:
  986.         stdcall vox_obj_rot_x, [open_file_vox]
  987.         call draw_objects
  988.         ret
  989.  
  990. ;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
  991. align 4
  992. but_plane_inc:
  993. push eax ecx
  994.         inc dword[n_plane]
  995.         mov eax,[v_zoom]
  996.         cmp eax,[scaled_zoom]
  997.         jle .end_0
  998.                 ;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
  999.                 mov ecx,[scaled_zoom]
  1000.                 xor eax,eax
  1001.                 inc eax
  1002.                 shl eax,cl
  1003.                 cmp eax,[n_plane]
  1004.                 jg @f
  1005.                         mov dword[n_plane],0
  1006.                         inc dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
  1007.                         neg ecx
  1008.                         ;inc ecx
  1009.                         add ecx,[v_zoom]
  1010.                         xor eax,eax
  1011.                         inc eax
  1012.                         shl eax,cl
  1013.                         cmp eax,[cam_y]
  1014.                         jg @f
  1015.                                 mov dword[cam_y],0 ;§ æ¨ª«¨¢ ¥¬ ¥á«¨ ¢ë«¥§«¨ §  ¯à¥¤¥«ë ¯®á«¥¤­¥£® ªã¡ 
  1016.                 @@:
  1017.                 jmp .end_1
  1018.         .end_0:
  1019.                 ;¬ áèâ ¡¨à®¢ ­¨¥ ­¥ ¯à®¨á室¨â
  1020.                 mov ecx,eax
  1021.                 xor eax,eax
  1022.                 inc eax
  1023.                 shl eax,cl
  1024.                 cmp eax,[n_plane]
  1025.                 jg .end_1
  1026.                         mov dword[n_plane],0
  1027.         .end_1:
  1028.         call draw_objects
  1029.         call draw_pok
  1030. pop ecx eax
  1031.         ret
  1032.  
  1033. ;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
  1034. align 4
  1035. but_plane_dec:
  1036.         dec dword[n_plane]
  1037.         cmp dword[n_plane],0
  1038.         jge .end_f
  1039. push eax ecx
  1040.         mov ecx,[scaled_zoom]
  1041.         xor eax,eax
  1042.         inc eax
  1043.         shl eax,cl
  1044.         dec eax
  1045.         mov dword[n_plane],eax
  1046.  
  1047.         mov eax,[v_zoom]
  1048.         cmp eax,[scaled_zoom]
  1049.         jle .end_0
  1050.                 ;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
  1051.                 dec dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
  1052.                 cmp dword[cam_y],0
  1053.                 jge .end_0
  1054.  
  1055.                 mov ecx,eax
  1056.                 sub ecx,[scaled_zoom]
  1057.                 xor eax,eax
  1058.                 inc eax
  1059.                 shl eax,cl
  1060.                 dec eax
  1061.                 mov dword[cam_y],eax ;¥á«¨ ­®¬¥à ªã¡  ®ª § «áï ¬¥­ìè¥ 0 ¨á¯à ¢«ï¥¬ ­  ¬ ªá¨¬ «ì­®¥ §­ ç¥­¨¥
  1062.         .end_0:
  1063. pop ecx eax
  1064.         .end_f:
  1065.         call draw_objects
  1066.         call draw_pok
  1067.         ret
  1068.  
  1069. align 4
  1070. but_mode_pen:
  1071.         push eax
  1072.         mov eax,dword[v_pen_mode]
  1073.         stdcall set_pen_mode,1,0,((9 shl 8)+9) shl 16 ;pen
  1074.         cmp eax,PEN_MODE_SELECT_COLOR
  1075.         jne @f
  1076.                 call draw_objects
  1077.         @@:
  1078.         pop eax
  1079.         ret
  1080.  
  1081. align 4
  1082. but_mode_brush:
  1083.         push eax
  1084.         mov eax,dword[v_pen_mode]
  1085.         stdcall set_pen_mode,3,1,((9 shl 8)+9) shl 16 ;brush
  1086.         cmp eax,PEN_MODE_SELECT_COLOR
  1087.         jne @f
  1088.                 call draw_objects
  1089.         @@:
  1090.         pop eax
  1091.         ret
  1092.  
  1093. align 4
  1094. but_mode_clear:
  1095.         push eax
  1096.         mov eax,dword[v_pen_mode]
  1097.         stdcall set_pen_mode,PEN_MODE_CLEAR,2,((15 shl 8)+9) shl 16
  1098.         cmp eax,PEN_MODE_SELECT_COLOR
  1099.         jne @f
  1100.                 call draw_objects
  1101.         @@:
  1102.         pop eax
  1103.         ret
  1104.  
  1105. align 4
  1106. but_light:
  1107.         xor dword[mode_light],1
  1108.         call draw_objects
  1109.         ret
  1110.  
  1111. align 4
  1112. but_rend_2_2:
  1113. push edi
  1114.         cmp dword[buf_r_img],0
  1115.         jne @f
  1116.                 ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï ७¤¥à 
  1117.                 push ecx esi
  1118.                 mov edi,buf_r_img
  1119.                 mov esi,buf_0
  1120.                 mov ecx,BUF_STRUCT_SIZE
  1121.                 cld
  1122.                 rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
  1123.                 mov edi,buf_r_img
  1124.                 mov buf2d_data,0
  1125.                 shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
  1126.                 shl buf2d_h,1
  1127.                 stdcall [buf2d_create],buf_r_img
  1128.  
  1129.                 mov edi,buf_r_z
  1130.                 mov esi,buf_0z
  1131.                 mov ecx,BUF_STRUCT_SIZE
  1132.                 cld
  1133.                 rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
  1134.                 mov edi,buf_r_z
  1135.                 mov buf2d_data,0
  1136.                 shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
  1137.                 shl buf2d_h,1
  1138.                 stdcall [buf2d_create],buf_r_z
  1139.                 pop esi ecx
  1140.         @@:
  1141.         stdcall [buf2d_clear], buf_r_img, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1142.         stdcall [buf2d_clear], buf_r_z, 0 ;ç¨á⨬ ¡ãä¥à
  1143.  
  1144.         push eax ebx ecx
  1145.                 mov eax,[v_zoom]
  1146.                 cmp eax,[scaled_zoom]
  1147.                 jle .end_scaled
  1148.                         ;७¤¥à 㢥«¨ç¥­­®© ç á⨠®¡ê¥ªâ 
  1149.                         mov ebx,[scaled_zoom]
  1150.                         sub eax,ebx
  1151.                         inc ebx
  1152.                         stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, [buf_vox],\
  1153.                                 [open_file_vox], 0,0, 0, ebx, [cam_x],[cam_y],[cam_z],eax, [sc.work_graph]
  1154.                         bt dword[mode_light],0
  1155.                         jnc @f
  1156.                                 stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, [buf_vox], 0,0, 0, ebx, 3
  1157.                         @@:
  1158.                         xor ebx,ebx
  1159.                         xor ecx,ecx
  1160.                         mov edi,buf_r_img
  1161.                         stdcall [buf2d_img_hdiv2], edi
  1162.                         shr buf2d_h,1
  1163.                         stdcall [buf2d_img_wdiv2], edi
  1164.                         shr buf2d_w,1
  1165.                         jmp .show
  1166.                 .end_scaled:
  1167.  
  1168.                 inc eax
  1169.                 stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, [buf_vox], [open_file_vox], 0,0, 0, eax
  1170.                 stdcall [buf2d_vox_obj_draw_1g], buf_r_img, buf_r_z, [open_file_vox], 0,0, eax
  1171.                 bt dword[mode_light],0
  1172.                 jnc @f
  1173.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, [buf_vox], 0,0, 0, eax, 3
  1174.                 @@:
  1175.  
  1176.                 mov edi,buf_r_img
  1177.                 stdcall [buf2d_img_hdiv2], edi
  1178.                 shr buf2d_h,1
  1179.                 stdcall [buf2d_img_wdiv2], edi
  1180.                 shr buf2d_w,1
  1181.  
  1182.                 stdcall [buf2d_vox_obj_get_img_w_3g], [buf_vox],[v_zoom]
  1183.                 mov ebx,[buf_0.w]
  1184.                 sub ebx,eax
  1185.                 shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
  1186.                 stdcall [buf2d_vox_obj_get_img_h_3g], [buf_vox],[v_zoom]
  1187.                 cmp eax,[buf_0.h]
  1188.                 jg @f
  1189.                         mov ecx,[buf_0.h]
  1190.                         sub ecx,eax
  1191.                         shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
  1192.                 @@:
  1193.                 .show:
  1194.                 stdcall [buf2d_bit_blt], buf_0, ebx,ecx, edi
  1195.                 shl buf2d_h,1
  1196.                 shl buf2d_w,1
  1197.         pop ecx ebx eax
  1198. pop edi
  1199.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1200.         ret
  1201.  
  1202. ;㬥­ìè ¥¬ è¨à¨­ã ª¨áâ¨
  1203. align 4
  1204. but_bru_w_m:
  1205.         cmp dword[brush_w],1
  1206.         jle @f
  1207.                 dec dword[brush_w]
  1208.                 pushad
  1209.                 call draw_pok
  1210.                 call draw_plane
  1211.                 popad
  1212.         @@:
  1213.         ret
  1214. ;㢥«¨ç¨¢ ¥¬ è¨à¨­ã ª¨áâ¨
  1215. align 4
  1216. but_bru_w_p:
  1217.         cmp dword[brush_w],32
  1218.         jge @f
  1219.                 inc dword[brush_w]
  1220.                 pushad
  1221.                 call draw_pok
  1222.                 call draw_plane
  1223.                 popad
  1224.         @@:
  1225.         ret
  1226. ;㬥­ìè ¥¬ ¢ëá®âã ª¨áâ¨
  1227. align 4
  1228. but_bru_h_m:
  1229.         cmp dword[brush_h],1
  1230.         jle @f
  1231.                 dec dword[brush_h]
  1232.                 pushad
  1233.                 call draw_pok
  1234.                 call draw_plane
  1235.                 popad
  1236.         @@:
  1237.         ret
  1238. ;㢥«¨ç¨¢ ¥¬ ¢ëá®âã ª¨áâ¨
  1239. align 4
  1240. but_bru_h_p:
  1241.         cmp dword[brush_h],32
  1242.         jge @f
  1243.                 inc dword[brush_h]
  1244.                 pushad
  1245.                 call draw_pok
  1246.                 call draw_plane
  1247.                 popad
  1248.         @@:
  1249.         ret
  1250.  
  1251. align 4
  1252. but_brush_copy:
  1253.         cmp dword[v_pen_mode],PEN_MODE_BRUSH
  1254.         jne .end_f
  1255. pushad
  1256.         mov eax,[v_cur_x]
  1257.         mov ebx,[n_plane]
  1258.         mov edx,[v_cur_y]
  1259.                
  1260.         mov ecx,[v_zoom]
  1261.         cmp ecx,[scaled_zoom]
  1262.         jle @f
  1263.                 ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
  1264.                 ;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
  1265.                 mov ecx,[scaled_zoom]
  1266.  
  1267.                 mov edi,[cam_x]
  1268.                 shl edi,cl
  1269.                 add eax,edi
  1270.                 mov edi,[cam_y]
  1271.                 shl edi,cl
  1272.                 add ebx,edi
  1273.                 mov edi,[cam_z]
  1274.                 shl edi,cl
  1275.                 add edx,edi
  1276.         @@:
  1277.  
  1278.         cld
  1279.         mov edi,brush_data
  1280.         mov esi,edx
  1281.         sub esi,[brush_h]
  1282.         .cycle_0:
  1283.         mov ecx,[brush_w]
  1284.         @@:
  1285.                 push eax
  1286.                 stdcall buf2d_vox_obj_node_get_color, [open_file_vox], eax,ebx,edx, [v_zoom]
  1287.                 cmp eax,[v_color]
  1288.                 jne .end_0
  1289.                         mov eax,1 shl 30
  1290.                 .end_0:
  1291.                 mov dword[edi],eax ;color
  1292.                 pop eax
  1293.                 inc eax
  1294.                 add edi,4
  1295.                 loop @b
  1296.         dec edx
  1297.         sub eax,[brush_w]
  1298.         cmp edx,esi
  1299.         jg .cycle_0
  1300.  
  1301.         call draw_objects
  1302. popad
  1303.         .end_f:
  1304.         ret
  1305.  
  1306. align 4
  1307. but_brush_draw:
  1308.         cmp dword[v_pen_mode],PEN_MODE_BRUSH
  1309.         jne .end_f
  1310. pushad
  1311.         mov eax,[v_cur_x]
  1312.         mov ebx,[n_plane]
  1313.         mov edx,[v_cur_y]
  1314.                
  1315.         mov ecx,[v_zoom]
  1316.         cmp ecx,[scaled_zoom]
  1317.         jle @f
  1318.                 ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
  1319.                 ;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
  1320.                 mov ecx,[scaled_zoom]
  1321.  
  1322.                 mov edi,[cam_x]
  1323.                 shl edi,cl
  1324.                 add eax,edi
  1325.                 mov edi,[cam_y]
  1326.                 shl edi,cl
  1327.                 add ebx,edi
  1328.                 mov edi,[cam_z]
  1329.                 shl edi,cl
  1330.                 add edx,edi
  1331.         @@:
  1332.  
  1333.         cld
  1334.         mov edi,brush_data
  1335.         mov esi,edx
  1336.         sub esi,[brush_h]
  1337.         .cycle_0:
  1338.         mov ecx,[brush_w]
  1339.         @@:
  1340.                 bt dword[edi],31 ;¡¨â ¯à®§à ç­®áâ¨
  1341.                 jc .end_2
  1342.                 bt dword[edi],30 ;¡¨â ⥪ã饣® 梥â 
  1343.                 jnc .end_0
  1344.                         push dword[v_color]
  1345.                         jmp .end_1
  1346.                 .end_0:
  1347.                         push dword[edi]
  1348.                 .end_1:
  1349.                 stdcall buf2d_vox_obj_create_node, [open_file_vox], eax,ebx,edx, [v_zoom] ;, color
  1350.                 .end_2:
  1351.                 inc eax
  1352.                 add edi,4
  1353.                 loop @b
  1354.         dec edx
  1355.         sub eax,[brush_w]
  1356.         cmp edx,esi
  1357.         jg .cycle_0
  1358.  
  1359.         call draw_objects
  1360. popad
  1361.         .end_f:
  1362.         ret
  1363.  
  1364. align 4
  1365. but_brush_clear:
  1366.         cmp dword[v_pen_mode],PEN_MODE_BRUSH
  1367.         jne .end_f
  1368. pushad
  1369.         mov eax,[v_cur_x]
  1370.         mov ebx,[n_plane]
  1371.         mov edx,[v_cur_y]
  1372.                
  1373.         mov ecx,[v_zoom]
  1374.         cmp ecx,[scaled_zoom]
  1375.         jle @f
  1376.                 ;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
  1377.                 ;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
  1378.                 mov ecx,[scaled_zoom]
  1379.  
  1380.                 mov edi,[cam_x]
  1381.                 shl edi,cl
  1382.                 add eax,edi
  1383.                 mov edi,[cam_y]
  1384.                 shl edi,cl
  1385.                 add ebx,edi
  1386.                 mov edi,[cam_z]
  1387.                 shl edi,cl
  1388.                 add edx,edi
  1389.         @@:
  1390.  
  1391.         cld
  1392.         mov edi,brush_data
  1393.         mov esi,edx
  1394.         sub esi,[brush_h]
  1395.         .cycle_0:
  1396.         mov ecx,[brush_w]
  1397.         @@:
  1398.                 bt dword[edi],31 ;¡¨â ¯à®§à ç­®áâ¨
  1399.                 jc .end_2
  1400.                 stdcall buf2d_vox_obj_delete_node, [open_file_vox], eax,ebx,edx, [v_zoom]
  1401.                 .end_2:
  1402.                 inc eax
  1403.                 add edi,4
  1404.                 loop @b
  1405.         dec edx
  1406.         sub eax,[brush_w]
  1407.         cmp edx,esi
  1408.         jg .cycle_0
  1409.  
  1410.         call draw_objects
  1411. popad
  1412.         .end_f:
  1413.         ret
  1414.  
  1415. align 4
  1416. draw_palete:
  1417.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1418.         stdcall buf2d_draw_palete, buf_0, 5,3, 9,6, 18, 512
  1419.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1420.         ret
  1421.  
  1422. align 4
  1423. v_zoom dd 3 ;⥪ã騩 ¬ áèâ ¡
  1424. v_cur_x dd 0 ;ª®®à¤¨­ â  ªãàá®à  x
  1425. v_cur_y dd 0 ;ª®®à¤¨­ â  ªãàá®à  y (­® ®áì ¢ ®¡ê¥ªâ¥ z)
  1426. n_plane dd 0 ;¯«®áª®áâì á¥ç¥­¨ï
  1427. v_color dd 0xff ;梥⠪ à ­¤ è 
  1428. v_pen_mode dd PEN_MODE_NONE ;०¨¬ à ¡®âë ªãàá®à  (á¬. ª®­áâ ­âë PEN_MODE_...)
  1429. mode_light dd 1 ;०¨¬ ®á¢¥é¥­¨ï
  1430. cam_x dd 0
  1431. cam_y dd 0
  1432. cam_z dd 0
  1433. scaled_zoom dd 5 ;¬ áèâ ¡ ¯®á«¥ ª®â®à®£® ­ ç¨­ ¥âáï à¨á®¢ ­¨¥ ç á⨠¨§®¡à ¦¥­¨ï
  1434. tile_size dd ? ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á á¥ç¥­¨¥¬
  1435. max_open_file_size dd ?
  1436. brush_w dd 5 ;è¨à¨­  ª¨áâ¨
  1437. brush_h dd 5 ;¢ëá®â  ª¨áâ¨
  1438. brush_data dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
  1439. dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
  1440. dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
  1441. dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
  1442. dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
  1443. rd 999 ;32*32-25
  1444.  
  1445. txt_zoom db 'Œ áèâ ¡:',0
  1446. txt_curor: db 'Šãàá®à: '
  1447. .size: rb 10
  1448. txt_n_plane db '‘¥ç¥­¨¥:',0
  1449. txt_color db '–¢¥â:',0
  1450. txt_brush: db 'Š¨áâì: '
  1451. .size: rb 10
  1452. txt_mull db '*',0
  1453. txt_space db ' ',0
  1454. txt_buf rb 16
  1455.  
  1456. ;à¨á®¢ ­¨¥ ¡ãä¥à  á ¢®ªá¥«ì­ë¬¨ ®¡ê¥ªâ ¬¨
  1457. align 4
  1458. draw_objects:
  1459.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1460.         stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
  1461.  
  1462.         cmp dword[v_pen_mode],PEN_MODE_SELECT_COLOR
  1463.         jne @f
  1464.                 call draw_palete
  1465.                 jmp .end_f
  1466.         @@:
  1467.         push eax ebx ecx
  1468.         stdcall [buf2d_vox_obj_get_img_w_3g], [buf_vox],[v_zoom]
  1469.         mov ebx,[buf_0.w]
  1470.         sub ebx,eax
  1471.         shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
  1472.  
  1473.         xor ecx,ecx
  1474.         stdcall [buf2d_vox_obj_get_img_h_3g], [buf_vox],[v_zoom]
  1475.         cmp eax,[buf_0.h]
  1476.         jg @f
  1477.                 mov ecx,[buf_0.h]
  1478.                 sub ecx,eax
  1479.                 shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
  1480.         @@:
  1481.  
  1482.         mov eax,[v_zoom]
  1483.         cmp eax,[scaled_zoom]
  1484.         jg @f
  1485.                 ;®¡ëç­ë© ०¨¬ ¨§®¡à ¦¥­¨ï
  1486.                 stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, [buf_vox],\
  1487.                         [open_file_vox], ebx,ecx, 0, eax
  1488.                 stdcall [buf2d_vox_obj_draw_1g], buf_0, buf_0z,\
  1489.                         [open_file_vox], 0,0, eax
  1490.                 bt dword[mode_light],0
  1491.                 jnc .end_1
  1492.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, [buf_vox], ebx,ecx, 0, eax, 3
  1493.                 .end_1:
  1494.                 jmp .end_0
  1495.         @@:
  1496.                 ;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  1497.                 sub eax,[scaled_zoom]
  1498.                 stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, [buf_vox],\
  1499.                         [open_file_vox], 0,0, 0, [scaled_zoom], [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] ;scroll -> 2^eax
  1500.                 bt dword[mode_light],0
  1501.                 jnc .end_2
  1502.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, [buf_vox], 0,0, 0, [scaled_zoom], 3
  1503.                 .end_2:
  1504.         .end_0:
  1505.         pop ecx ebx eax
  1506.  
  1507.         call draw_plane
  1508.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1509.         .end_f:
  1510.         ret
  1511.  
  1512. ;à¨á®¢ ­¨¥ ¯«®áª®á⨠á á¥ç¥­¨¥¬ ®¡ê¥ªâ 
  1513. align 4
  1514. proc draw_plane uses eax
  1515.         stdcall [buf2d_clear], buf_pl, [buf_pl.color] ;ç¨á⨬ ¡ãä¥à
  1516.  
  1517.         mov eax,[v_zoom]
  1518.         cmp eax,[scaled_zoom]
  1519.         jg @f
  1520.                 ;®¡ëç­ë© ०¨¬ ¨§®¡à ¦¥­¨ï
  1521.                 stdcall [buf2d_vox_obj_draw_pl], buf_pl, [open_file_vox],\
  1522.                         OT_MAP_X,OT_MAP_Y,[tile_size], eax, [n_plane], [sc.work_graph]
  1523.                 jmp .end_0
  1524.         @@:
  1525.                 ;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  1526.                 sub eax,[scaled_zoom]
  1527.                 stdcall [buf2d_vox_obj_draw_pl_scaled], buf_pl, [open_file_vox],\
  1528.                         OT_MAP_X,OT_MAP_Y,[tile_size], [scaled_zoom], [n_plane], [sc.work_graph],[cam_x],[cam_y],[cam_z],eax
  1529.         .end_0:
  1530.  
  1531.         call draw_vox_cursor
  1532.         stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1533.         .end_f:
  1534.         ret
  1535. endp
  1536.  
  1537. ;à¨á®¢ ­¨¥ ªãàá®à 
  1538. align 4
  1539. draw_vox_cursor:
  1540. pushad
  1541.         mov ecx,[v_zoom]
  1542.         cmp ecx,[scaled_zoom]
  1543.         jle @f
  1544.                 mov ecx,[scaled_zoom]
  1545.         @@:
  1546.         xor edx,edx
  1547.         inc edx
  1548.         shl edx,cl
  1549.  
  1550.         mov eax,[v_cur_x]
  1551.         cmp eax,edx
  1552.         jge .end_f ;ªãàá®à §  ¯à¥¤¥« ¬¨ ¯®«ï
  1553.         mov edi,[tile_size]
  1554.         imul eax,edi
  1555.         add eax,OT_MAP_X
  1556.         mov ebx,edx
  1557.         dec ebx
  1558.         sub ebx,[v_cur_y]
  1559.         imul ebx,edi
  1560.         add ebx,OT_MAP_Y
  1561.         inc eax
  1562.         cmp dword[v_pen_mode],PEN_MODE_BRUSH
  1563.         je .brush
  1564.         inc ebx
  1565.     sub edi,2
  1566.         stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,edi,[sc.work_graph]
  1567.         dec ebx
  1568.         add edi,2
  1569.  
  1570.         ;£®à¨§®­â «ì­ë¥ «¨­¨¨
  1571.         sub eax,2
  1572.         mov ecx,edi
  1573.         imul edi,edx
  1574.         shr ecx,1
  1575.         add ebx,ecx ;業â஢ª  ¯® á¥à¥¤¨­¥ ª«¥âª¨
  1576.         mov ecx,OT_MAP_X
  1577.         add edi,ecx
  1578.         stdcall [buf2d_line], buf_pl, ecx,ebx, eax,ebx,[sc.work_graph]
  1579.         add eax,[tile_size]
  1580.         inc eax
  1581.         cmp eax,edi
  1582.         jge @f ;¥á«¨ ªãàá®à ­  ªà î ¯®«ï
  1583.                 dec edi
  1584.                 stdcall [buf2d_line], buf_pl, eax,ebx, edi,ebx,[sc.work_graph]
  1585.         @@:
  1586.         jmp .end_f
  1587.  
  1588.         ;à ¬ª  ¤«ï ª¨áâ¨
  1589.         .brush:
  1590.         dec eax
  1591.         mov ecx,[brush_w]
  1592.         imul ecx,[tile_size]
  1593.         ;mov edi,eax
  1594.         mov edi,ecx
  1595.         mov esi,[brush_h]
  1596.         imul esi,[tile_size]
  1597.         stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,esi,[sc.work_graph]
  1598.  
  1599.     ;à¨á®¢ ­¨¥ â®ç¥ª ¤«ï ª¨áâ¨
  1600.     mov ecx,[brush_w]
  1601.     mov edx,[tile_size]
  1602.     sub eax,edx ;eax-=tile_size
  1603.     shr edx,2
  1604.     add eax,edx ;eax+=tile_size/4
  1605.     add ebx,edx ;ebx+=tile_size/4
  1606.     mov edx,eax
  1607.     mov esi,[tile_size]
  1608.     imul esi,ecx
  1609.     imul ecx,[brush_h]
  1610.     add esi,edx
  1611.     ;eax = from edx to esi
  1612.     mov edi,brush_data
  1613.     cld
  1614.     @@:
  1615.         add eax,[tile_size]
  1616.         bt dword[edi],31
  1617.         jc .no_pixel
  1618.             bt dword[edi],30
  1619.             jc .sel_color
  1620.                 push dword[edi]
  1621.                 jmp .set_pixel
  1622.             .sel_color:
  1623.                 push [v_color]
  1624.             .set_pixel:
  1625.             stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, 3,3 ;, [edi]
  1626.         .no_pixel:
  1627.         add edi,4
  1628.         cmp eax,esi
  1629.         jl .end_line        
  1630.             mov eax,edx
  1631.             add ebx,[tile_size]
  1632.         .end_line:
  1633.     loop @b
  1634.  
  1635.         .end_f:
  1636. popad
  1637.         ret
  1638.  
  1639. ;hot_p - ª®®à¤¨­ âë £®àï祩 â®çª¨ ªãàá®à , ᬥ饭­ë¥ ­  ¡¨â 16 ((cx shl 8) + cy) shl 16
  1640. align 4
  1641. proc set_pen_mode uses eax ebx ecx edx, mode:dword, icon:dword, hot_p:dword
  1642.         mov eax,[mode]
  1643.         cmp [v_pen_mode],eax
  1644.         je @f
  1645.                 mov [v_pen_mode],eax
  1646.                 mov edx,[hot_p]
  1647.                 mov dx,2 ;LOAD_INDIRECT
  1648.                 mov ecx,[icon]
  1649.                 shl ecx,12 ;㬭®¦ ¥¬ ­  4 ª¡
  1650.                 add ecx,[buf_curs.data]
  1651.                 mcall 37,4
  1652.  
  1653.                 cmp eax,0
  1654.                 je @f
  1655.                         mov [cursor_pointer],eax
  1656.                         mcall 37,5,[cursor_pointer]
  1657.         @@:
  1658.         ret
  1659. endp
  1660.  
  1661. if 0
  1662. ;input:
  1663. ; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
  1664. ;output:
  1665. ; eax - ç¨á«®
  1666. align 4
  1667. proc conv_str_to_int, buf:dword
  1668.         xor eax,eax
  1669.         push ebx ecx esi
  1670.         xor ebx,ebx
  1671.         mov esi,[buf]
  1672.         ;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
  1673.         xor ecx,ecx
  1674.         inc ecx
  1675.         cmp byte[esi],'-'
  1676.         jne @f
  1677.                 dec ecx
  1678.                 inc esi
  1679.         @@:
  1680.  
  1681.         cmp word[esi],'0x'
  1682.         je .load_digit_16
  1683.  
  1684.         .load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
  1685.                 mov bl,byte[esi]
  1686.                 cmp bl,'0'
  1687.                 jl @f
  1688.                 cmp bl,'9'
  1689.                 jg @f
  1690.                         sub bl,'0'
  1691.                         imul eax,10
  1692.                         add eax,ebx
  1693.                         inc esi
  1694.                         jmp .load_digit_10
  1695.         jmp @f
  1696.  
  1697.         .load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
  1698.                 add esi,2
  1699.         .cycle_16:
  1700.                 mov bl,byte[esi]
  1701.                 cmp bl,'0'
  1702.                 jl @f
  1703.                 cmp bl,'f'
  1704.                 jg @f
  1705.                 cmp bl,'9'
  1706.                 jle .us1
  1707.                         cmp bl,'A'
  1708.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
  1709.                 .us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
  1710.                 cmp bl,'F'
  1711.                 jle .us2
  1712.                         cmp bl,'a'
  1713.                         jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
  1714.                         sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
  1715.                 .us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
  1716.                         sub bl,'0'
  1717.                         cmp bl,9
  1718.                         jle .cor1
  1719.                                 sub bl,7 ;convert 'A' to '10'
  1720.                         .cor1:
  1721.                         shl eax,4
  1722.                         add eax,ebx
  1723.                         inc esi
  1724.                         jmp .cycle_16
  1725.         @@:
  1726.         cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
  1727.         jne @f
  1728.                 sub ecx,eax
  1729.                 mov eax,ecx
  1730.         @@:
  1731.         pop esi ecx ebx
  1732.         ret
  1733. endp
  1734. end if
  1735.  
  1736. ;input:
  1737. ; eax = value
  1738. ; edi = string buffer
  1739. ;output:
  1740. align 4
  1741. convert_int_to_str:
  1742.         pushad
  1743.                 mov dword[edi+1],0
  1744.                 mov word[edi+5],0
  1745.                 call .str
  1746.         popad
  1747.         ret
  1748.  
  1749. align 4
  1750. .str:
  1751.         mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
  1752.     ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
  1753.         cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
  1754.         jb @f
  1755.                 xor edx,edx  ;®ç¨áâ¨âì edx
  1756.                 div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
  1757.                 push edx     ;¯®«®¦¨âì ¢ á⥪
  1758.                 ;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
  1759.                 call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
  1760.                 pop eax
  1761.         @@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
  1762.         or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  ç¥¬ ¤¢¥ ¢ëè¥
  1763.         stosb       ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
  1764.         ret           ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
  1765.  
  1766. align 4
  1767. proc str_cat, str1:dword, str2:dword
  1768.         push eax ecx edi esi
  1769.         mov esi,dword[str2]
  1770.         stdcall str_len,esi
  1771.         mov ecx,eax
  1772.         inc ecx
  1773.         mov edi,dword[str1]
  1774.         stdcall str_len,edi
  1775.         add edi,eax
  1776.         cld
  1777.         repne movsb
  1778.         pop esi edi ecx eax
  1779.         ret
  1780. endp
  1781.  
  1782. ;output:
  1783. ; eax = strlen
  1784. align 4
  1785. proc str_len, str1:dword
  1786.         mov eax,[str1]
  1787.         @@:
  1788.                 cmp byte[eax],0
  1789.                 je @f
  1790.                 inc eax
  1791.                 jmp @b
  1792.         @@:
  1793.         sub eax,[str1]
  1794.         ret
  1795. endp
  1796.  
  1797. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  1798. align 4
  1799. OpenDialog_data:
  1800. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  1801. .procinfo               dd procinfo     ;+4
  1802. .com_area_name          dd communication_area_name      ;+8
  1803. .com_area               dd 0    ;+12
  1804. .opendir_path           dd plugin_path  ;+16
  1805. .dir_default_path       dd default_dir ;+20
  1806. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  1807. .draw_window            dd draw_window  ;+28
  1808. .status                 dd 0    ;+32
  1809. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  1810. .filename_area          dd filename_area        ;+40
  1811. .filter_area            dd Filter
  1812. .x:
  1813. .x_size                 dw 420 ;+48 ; Window X size
  1814. .x_start                dw 10 ;+50 ; Window X position
  1815. .y:
  1816. .y_size                 dw 320 ;+52 ; Window y size
  1817. .y_start                dw 10 ;+54 ; Window Y position
  1818.  
  1819. default_dir db '/rd/1',0
  1820.  
  1821. communication_area_name:
  1822.         db 'FFFFFFFF_open_dialog',0
  1823. open_dialog_name:
  1824.         db 'opendial',0
  1825. communication_area_default_path:
  1826.         db '/rd/1/File managers/',0
  1827.  
  1828. Filter:
  1829. dd Filter.end - Filter ;.1
  1830. .1:
  1831. db 'VOX',0
  1832. .end:
  1833. db 0
  1834.  
  1835.  
  1836.  
  1837. head_f_i:
  1838. head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  1839.  
  1840. system_dir_0 db '/sys/lib/'
  1841. lib_name_0 db 'proc_lib.obj',0
  1842. err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  1843. err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  1844.  
  1845. system_dir_1 db '/sys/lib/'
  1846. lib_name_1 db 'libimg.obj',0
  1847. err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  1848. err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  1849.  
  1850. system_dir_2 db '/sys/lib/'
  1851. lib_name_2 db 'buf2d.obj',0
  1852. err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
  1853. err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
  1854.  
  1855. system_dir_3 db '/sys/lib/'
  1856. lib_name_3 db 'libini.obj',0
  1857. err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
  1858. err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini',39,0
  1859.  
  1860. l_libs_start:
  1861.         lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  1862.                 err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
  1863.         lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  1864.                 err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
  1865.         lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
  1866.                 err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
  1867.         lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
  1868.                 err_msg_found_lib_3,head_f_l,import_libini,err_msg_import_3,head_f_i
  1869. l_libs_end:
  1870.  
  1871. align 4
  1872. import_libimg:
  1873.         dd alib_init1
  1874.         img_is_img  dd aimg_is_img
  1875.         img_info    dd aimg_info
  1876.         img_from_file dd aimg_from_file
  1877.         img_to_file dd aimg_to_file
  1878.         img_from_rgb dd aimg_from_rgb
  1879.         img_to_rgb  dd aimg_to_rgb
  1880.         img_to_rgb2 dd aimg_to_rgb2
  1881.         img_decode  dd aimg_decode
  1882.         img_encode  dd aimg_encode
  1883.         img_create  dd aimg_create
  1884.         img_destroy dd aimg_destroy
  1885.         img_destroy_layer dd aimg_destroy_layer
  1886.         img_count   dd aimg_count
  1887.         img_lock_bits dd aimg_lock_bits
  1888.         img_unlock_bits dd aimg_unlock_bits
  1889.         img_flip    dd aimg_flip
  1890.         img_flip_layer dd aimg_flip_layer
  1891.         img_rotate  dd aimg_rotate
  1892.         img_rotate_layer dd aimg_rotate_layer
  1893.         img_draw    dd aimg_draw
  1894.  
  1895.         dd 0,0
  1896.         alib_init1   db 'lib_init',0
  1897.         aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
  1898.         aimg_info    db 'img_info',0
  1899.         aimg_from_file db 'img_from_file',0
  1900.         aimg_to_file db 'img_to_file',0
  1901.         aimg_from_rgb db 'img_from_rgb',0
  1902.         aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
  1903.         aimg_to_rgb2 db 'img_to_rgb2',0
  1904.         aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
  1905.         aimg_encode  db 'img_encode',0
  1906.         aimg_create  db 'img_create',0
  1907.         aimg_destroy db 'img_destroy',0
  1908.         aimg_destroy_layer db 'img_destroy_layer',0
  1909.         aimg_count   db 'img_count',0
  1910.         aimg_lock_bits db 'img_lock_bits',0
  1911.         aimg_unlock_bits db 'img_unlock_bits',0
  1912.         aimg_flip    db 'img_flip',0
  1913.         aimg_flip_layer db 'img_flip_layer',0
  1914.         aimg_rotate  db 'img_rotate',0
  1915.         aimg_rotate_layer db 'img_rotate_layer',0
  1916.         aimg_draw    db 'img_draw',0
  1917.  
  1918. align 4
  1919. proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  1920.         OpenDialog_Init dd aOpenDialog_Init
  1921.         OpenDialog_Start dd aOpenDialog_Start
  1922. dd 0,0
  1923.         aOpenDialog_Init db 'OpenDialog_init',0
  1924.         aOpenDialog_Start db 'OpenDialog_start',0
  1925.  
  1926. align 4
  1927. import_buf2d:
  1928.         init dd sz_init
  1929.         buf2d_create dd sz_buf2d_create
  1930.         buf2d_create_f_img dd sz_buf2d_create_f_img
  1931.         buf2d_clear dd sz_buf2d_clear
  1932.         buf2d_draw dd sz_buf2d_draw
  1933.         buf2d_delete dd sz_buf2d_delete
  1934.         buf2d_line dd sz_buf2d_line
  1935.         buf2d_rect_by_size dd sz_buf2d_rect_by_size
  1936.         buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
  1937.         buf2d_circle dd sz_buf2d_circle
  1938.         buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
  1939.         buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
  1940.         buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
  1941.         buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
  1942.         buf2d_bit_blt dd sz_buf2d_bit_blt
  1943.         buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
  1944.         buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
  1945.         buf2d_curve_bezier dd sz_buf2d_curve_bezier
  1946.         buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
  1947.         buf2d_draw_text dd sz_buf2d_draw_text
  1948.         buf2d_crop_color dd sz_buf2d_crop_color
  1949.         buf2d_offset_h dd sz_buf2d_offset_h
  1950.         buf2d_flood_fill dd sz_buf2d_flood_fill
  1951.         buf2d_set_pixel dd sz_buf2d_set_pixel
  1952.         buf2d_get_pixel dd sz_buf2d_get_pixel
  1953.         buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
  1954.         buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
  1955.         buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
  1956.         buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
  1957.         buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
  1958.         buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
  1959.         buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
  1960.         buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
  1961.         buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
  1962.         buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
  1963.  
  1964.         dd 0,0
  1965.         sz_init db 'lib_init',0
  1966.         sz_buf2d_create db 'buf2d_create',0
  1967.         sz_buf2d_create_f_img db 'buf2d_create_f_img',0
  1968.         sz_buf2d_clear db 'buf2d_clear',0
  1969.         sz_buf2d_draw db 'buf2d_draw',0
  1970.         sz_buf2d_delete db 'buf2d_delete',0
  1971.         sz_buf2d_line db 'buf2d_line',0
  1972.         sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
  1973.         sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
  1974.         sz_buf2d_circle db 'buf2d_circle',0
  1975.         sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
  1976.         sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
  1977.         sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
  1978.         sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
  1979.         sz_buf2d_bit_blt db 'buf2d_bit_blt',0
  1980.         sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
  1981.         sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
  1982.         sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
  1983.         sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
  1984.         sz_buf2d_draw_text db 'buf2d_draw_text',0
  1985.         sz_buf2d_crop_color db 'buf2d_crop_color',0
  1986.         sz_buf2d_offset_h db 'buf2d_offset_h',0
  1987.         sz_buf2d_flood_fill db 'buf2d_flood_fill',0
  1988.         sz_buf2d_set_pixel db 'buf2d_set_pixel',0
  1989.         sz_buf2d_get_pixel db 'buf2d_get_pixel',0
  1990.         sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
  1991.         sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
  1992.         sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
  1993.         sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
  1994.         sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
  1995.         sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
  1996.         sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
  1997.         sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
  1998.         sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
  1999.         sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
  2000.  
  2001. align 4
  2002. import_libini:
  2003.         dd alib_init2
  2004.         ini_get_str   dd aini_get_str
  2005.         ini_get_int   dd aini_get_int
  2006.         ini_get_color dd aini_get_color
  2007. dd 0,0
  2008.         alib_init2     db 'lib_init',0
  2009.         aini_get_str   db 'ini_get_str',0
  2010.         aini_get_int   db 'ini_get_int',0
  2011.         aini_get_color db 'ini_get_color',0
  2012.  
  2013. mouse_dd dd 0x0
  2014. sc system_colors
  2015.  
  2016. align 16
  2017. procinfo process_information
  2018.  
  2019. ;¡ãä¥à ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
  2020. align 4
  2021. buf_0: dd 0 ;㪠§ â¥«ì ­  ¤a­ë¥ ¨§®¡à ¦¥­¨ï
  2022. .l: dw 5 ;+4 left
  2023. .t: dw 45 ;+6 top
  2024. .w: dd 192+6 ;+8 w
  2025. .h: dd 224+7 ;+12 h
  2026. .color: dd 0xffffff ;+16 color
  2027.         db 24 ;+20 bit in pixel
  2028.  
  2029. ;¡ãä¥à £«ã¡¨­ë ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
  2030. align 4
  2031. buf_0z: dd 0
  2032.         dw 0 ;+4 left
  2033.         dw 0 ;+6 top
  2034. .w: dd 192+6 ;+8 w
  2035. .h: dd 224+7 ;+12 h
  2036. .color: dd 0 ;+16 color
  2037.         db 32 ;+20 bit in pixel
  2038.  
  2039. ;¡ãä¥à ¤«ï à¨á®¢ ­¨ï á१  ®¡ê¥ªâ 
  2040. align 4
  2041. buf_pl: dd 0
  2042. .l: dw 15+192+6 ;+4 left
  2043. .t: dw 45 ;+6 top
  2044. .w: dd 320 ;+8 w
  2045. .h: dd 330 ;+12 h
  2046. .color: dd 0xffffff ;+16 color
  2047.         db 24 ;+20 bit in pixel
  2048.  
  2049. ;¡ãä¥à ¤«ï ã«ãç襭®£® ७¤¥à 
  2050. align 4
  2051. buf_r_img:
  2052.         rb BUF_STRUCT_SIZE
  2053. align 4
  2054. buf_r_z:
  2055.         rb BUF_STRUCT_SIZE
  2056.  
  2057. align 4
  2058. cursor_pointer dd 0 ;㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï ªãàá®à 
  2059.  
  2060. buf_curs: ;¡ãä¥à á ªãàá®à ¬¨
  2061. .data: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  2062.         dw 0 ;+4 left
  2063.         dw 0 ;+6 top
  2064.         dd 32 ;+8 w
  2065.         dd 32*cursors_count ;+12 h
  2066.         dd 0 ;+16 color
  2067.         db 24 ;+20 bit in pixel
  2068.  
  2069. align 4
  2070. buf_curs_8: ;¡ãä¥à á ¯à®§à ç­®áâìî ¤«ï ªãàá®à®¢
  2071. .data: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  2072.         dw 0 ;+4 left
  2073.         dw 0 ;+6 top
  2074.         dd 32 ;+8 w
  2075.         dd 32*cursors_count ;+12 h
  2076.         dd 0 ;+16 color
  2077.         db 24 ;+20 bit in pixel
  2078.  
  2079. ;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
  2080. align 4
  2081. vox_6_7_z: ;¢®ªá¥«ì £¤¥ ¢¨¤­® 3 £à ­¨
  2082. dd 0,0,1,1,0,0,\
  2083.    0,2,2,2,2,0,\
  2084.    2,2,2,2,2,2,\
  2085.    2,3,2,2,3,2,\
  2086.    2,3,3,3,3,2,\
  2087.    0,3,3,3,3,0,\
  2088.    0,0,3,3,0,0
  2089.  
  2090. align 4
  2091. vox_6_4_z: ;¢®ªá¥«ì, £¤¥ ¢¨¤­® 2 ¡®ª®¢ë¥ £à ­¨   ¢¥àå­¥© £à ­¨ ­¥ ¢¨¤­®
  2092. dd 1,2,3,3,2,1,\
  2093.    1,2,3,3,2,1,\
  2094.    1,2,3,3,2,1,\
  2095.    1,2,3,3,2,1
  2096.  
  2097. align 4
  2098. buf_vox dd buf_vox_g3
  2099.  
  2100. buf_vox_g3:
  2101.         db 6,7,4,3 ;w,h,h_osn,n
  2102.         rb BUF_STRUCT_SIZE*(3+1)
  2103.  
  2104. align 4
  2105. buf_vox_g2:
  2106.         db 6,4,0,3 ;w,h,h_osn,n
  2107.         rb BUF_STRUCT_SIZE*(3+1)
  2108.  
  2109. i_end:
  2110.         wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
  2111.                 rq 0
  2112.         rb 4096 ;2048
  2113. stacktop:
  2114.         sys_path rb 1024
  2115.         file_name:
  2116.                 rb 1024 ;4096
  2117.         library_path rb 1024
  2118.         plugin_path rb 1024 ;4096
  2119.         openfile_path rb 1024 ;4096
  2120.         filename_area rb 256
  2121. mem:
  2122.