Subversion Repositories Kolibri OS

Rev

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