Subversion Repositories Kolibri OS

Rev

Rev 3969 | Rev 6259 | 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 '../../../../programs/dll.inc'
  16. include '../trunk/vox_draw.inc'
  17. include '../trunk/vox_rotate.inc'
  18. include '../trunk/str.inc'
  19.  
  20. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  21. caption db 'Voxel mover 29.01.15',0 ;¯®¤¯¨áì ®ª­ 
  22.  
  23. struct FileInfoBlock
  24.         Function dd ?
  25.         Position dd ?
  26.         Flags    dd ?
  27.         Count    dd ?
  28.         Buffer   dd ?
  29.                 db ?
  30.         FileName dd ?
  31. ends
  32.  
  33. run_file_70 FileInfoBlock
  34. image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  35.  
  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 'toolbar_m.png', 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.         mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4],,,caption
  356.  
  357.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  358.         mov esi,[sc.work_button]
  359.         mcall 8,(5 shl 16)+20,(5 shl 16)+20,3
  360.  
  361.         mov ebx,(30 shl 16)+20
  362.         mov edx,4
  363.         int 0x40
  364.         add ebx,25 shl 16
  365.         mov edx,5
  366.         int 0x40
  367.         add ebx,30 shl 16
  368.         mov edx,6
  369.         int 0x40
  370.         add ebx,25 shl 16
  371.         mov edx,7
  372.         int 0x40
  373.         add ebx,25 shl 16
  374.         mov edx,8
  375.         int 0x40
  376.         add ebx,25 shl 16
  377.         mov edx,9
  378.         int 0x40
  379.         add ebx,25 shl 16
  380.         mov edx,10
  381.         int 0x40
  382.         add ebx,25 shl 16
  383.         mov edx,11
  384.         int 0x40
  385.         add ebx,25 shl 16
  386.         mov edx,12
  387.         int 0x40
  388.         add ebx,25 shl 16
  389.         mov edx,13
  390.         int 0x40
  391.         add ebx,25 shl 16
  392.         mov edx,14
  393.         int 0x40
  394.         add ebx,25 shl 16
  395.         mov edx,15
  396.         int 0x40
  397.         add ebx,25 shl 16
  398.         mov edx,16
  399.         int 0x40
  400.         add ebx,25 shl 16
  401.         mov edx,17
  402.         int 0x40
  403.         add ebx,25 shl 16
  404.         mov edx,18
  405.         int 0x40
  406.         add ebx,25 shl 16
  407.         mov edx,19
  408.         int 0x40
  409.         add ebx,25 shl 16
  410.         mov edx,20
  411.         int 0x40
  412.  
  413.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  414.         mov edx,(7 shl 16)+7 ;icon new
  415.         mcall 7,[image_data_toolbar],(16 shl 16)+16
  416.  
  417.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  418.         add edx,(25 shl 16) ;icon open
  419.         int 0x40
  420.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  421.         add edx,(25 shl 16) ;icon save
  422.         int 0x40
  423.  
  424.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  425.         add edx,(30 shl 16) ;㢥«¨ç. ¬ áèâ ¡
  426.         int 0x40
  427.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  428.         add edx,(25 shl 16) ;㬥­ìè. ¬ áèâ ¡
  429.         int 0x40
  430.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  431.         add edx,(25 shl 16) ;¯®¢®à®â 1
  432.         int 0x40
  433.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  434.         add edx,(25 shl 16) ;¯®¢®à®â 2
  435.         int 0x40
  436.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  437.         add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠+
  438.         int 0x40
  439.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  440.         add edx,(25 shl 16) ;ᤢ¨£ ¯«®áª®á⨠-
  441.         int 0x40
  442.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  443.         add edx,(25 shl 16) ;®á¢¥é¥­¨¥
  444.         int 0x40
  445.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  446.         add edx,(25 shl 16) ;७¤¥à 2*2
  447.         int 0x40
  448.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  449.         add edx,(25 shl 16) ;
  450.         int 0x40
  451.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  452.         add edx,(25 shl 16) ;
  453.         int 0x40
  454.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  455.         add edx,(25 shl 16) ;
  456.         int 0x40
  457.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  458.         add edx,(25 shl 16) ;
  459.         int 0x40
  460.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  461.         add edx,(25 shl 16) ;
  462.         int 0x40
  463.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  464.         add edx,(25 shl 16) ;
  465.         int 0x40
  466.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  467.         add edx,(25 shl 16) ;
  468.         int 0x40
  469.  
  470.         ; *** à¨á®¢ ­¨¥ ¡ãä¥à®¢ ***
  471.         call draw_objects
  472.         call draw_pok
  473.  
  474.         mcall 12,2
  475. popad
  476.         ret
  477.  
  478. align 4
  479. draw_pok:
  480.         mov esi,[sc.work_button_text]
  481.         or  esi,(1 shl 30)
  482.         mov edi,[sc.work_button]
  483.         mcall 47, (3 shl 16)+(1 shl 31), [v_zoom], ((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2 ;¬ áèâ ¡
  484.         mov ecx,[n_plane]
  485.         add edx,115 shl 16 ;9
  486.         int 0x40 ;­®¬¥à á¥ç¥­¨ï
  487.  
  488.         ;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ªãàá®à 
  489.         mov dword[txt_curor.size],0
  490.         mov eax,dword[v_cur_x]
  491.         mov edi,txt_curor.size
  492.         stdcall convert_int_to_str,10
  493.         stdcall str_cat, edi,txt_mull
  494.         mov eax,dword[v_cur_y]
  495.         mov edi,txt_buf
  496.         stdcall convert_int_to_str,16
  497.         stdcall str_cat, txt_curor.size,edi
  498.         stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
  499.  
  500.         ;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ª¨áâ¨
  501.         mov dword[txt_mov_offs.size],0
  502.         mov eax,dword[mov_x]
  503.         mov edi,txt_mov_offs.size
  504.         stdcall convert_int_to_str,30
  505.         stdcall str_cat, edi,txt_space
  506.         mov eax,dword[mov_y]
  507.         mov edi,txt_buf
  508.         stdcall convert_int_to_str,16
  509.         stdcall str_cat, txt_mov_offs.size,edi
  510.         stdcall str_cat, txt_mov_offs.size,txt_space
  511.         mov eax,dword[mov_z]
  512.         mov edi,txt_buf
  513.         stdcall convert_int_to_str,16
  514.         stdcall str_cat, txt_mov_offs.size,edi
  515.         stdcall str_cat, txt_mov_offs.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
  516.  
  517.         ;à¨á®¢ ­¨¥ ⥪áâ 
  518.         mov ecx,[sc.work_text]
  519.         or  ecx,0x80000000 ;or (1 shl 30)
  520.         mcall 4, (OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2,,txt_color
  521.  
  522.         mov edx,txt_curor
  523.         add ebx,115 shl 16
  524.         or  ecx,(1 shl 30)
  525.         mov edi,[sc.work]
  526.         int 0x40
  527.  
  528.         mov edx,txt_mov_offs
  529.         add ebx,115 shl 16
  530.         int 0x40
  531.  
  532.         mov edx,txt_zoom
  533.         add ebx,115 shl 16
  534.         int 0x40
  535.  
  536.         mov edx,txt_n_plane
  537.         add ebx,115 shl 16
  538.         int 0x40
  539.  
  540.         call on_change_color
  541.         ret
  542.  
  543. align 4
  544. on_change_color:
  545. pushad
  546.         mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
  547.         mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
  548.         mcall 13,,,[v_color]
  549.  
  550.         mov ecx,edx
  551.         mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
  552.         mov esi,[sc.work_text]
  553.         add esi,(1 shl 30)
  554.         mov edi,[sc.work]
  555.         mcall 47,(1 shl 8)+(6 shl 16)
  556. popad
  557.         ret
  558.  
  559. align 4
  560. key:
  561.         mcall 2
  562.         jmp still
  563.  
  564.  
  565. align 4
  566. button:
  567.         mcall 17
  568.         cmp ah,3
  569.         jne @f
  570.                 stdcall but_new_file, [open_file_vox]
  571.                 call draw_objects
  572.                 call draw_pok
  573.         @@:
  574.         cmp ah,4
  575.         jne @f
  576.                 call but_open_file
  577.         @@:
  578.         cmp ah,5
  579.         jne @f
  580.                 call but_save_file
  581.         @@:
  582.         cmp ah,6
  583.         jne @f
  584.                 call but_zoom_p
  585.         @@:
  586.         cmp ah,7
  587.         jne @f
  588.                 call but_zoom_m
  589.         @@:
  590.         cmp ah,8
  591.         jne @f
  592.                 call but_3
  593.         @@:
  594.         cmp ah,9
  595.         jne @f
  596.                 call but_4
  597.         @@:
  598.         cmp ah,10
  599.         jne @f
  600.                 call but_plane_inc
  601.         @@:
  602.         cmp ah,11
  603.         jne @f
  604.                 call but_plane_dec
  605.         @@:
  606.         cmp ah,12
  607.         jne @f
  608.                 call but_light
  609.         @@:
  610.         cmp ah,13
  611.         jne @f
  612.                 call but_rend_2_2
  613.         @@:
  614.         cmp ah,14
  615.         jne @f
  616.                 call but_move
  617.         @@:
  618.         cmp ah,15
  619.         jne @f
  620.                 dec dword[mov_x]
  621.                 call draw_pok
  622.         @@:
  623.         cmp ah,16
  624.         jne @f
  625.                 inc dword[mov_x]
  626.                 call draw_pok
  627.         @@:
  628.         cmp ah,17
  629.         jne @f
  630.                 dec dword[mov_y]
  631.                 call draw_pok
  632.         @@:
  633.         cmp ah,18
  634.         jne @f
  635.                 inc dword[mov_y]
  636.                 call draw_pok
  637.         @@:
  638.         cmp ah,19
  639.         jne @f
  640.                 dec dword[mov_z]
  641.                 call draw_pok
  642.         @@:
  643.         cmp ah,20
  644.         jne @f
  645.                 inc dword[mov_z]
  646.                 call draw_pok
  647.         @@:
  648.         cmp ah,1
  649.         jne still
  650. .exit:
  651.         stdcall [buf2d_delete],buf_0
  652.         stdcall [buf2d_delete],buf_0z
  653.         cmp dword[buf_r_img],0
  654.         je @f
  655.                 stdcall [buf2d_delete],buf_r_img
  656.                 stdcall [buf2d_delete],buf_r_z
  657.         @@:
  658.         stdcall [buf2d_vox_brush_delete], buf_vox
  659.         stdcall mem.Free,[image_data_toolbar]
  660.         stdcall mem.Free,[open_file_vox]
  661.         stdcall mem.Free,[moved_file_vox]
  662.         mcall -1
  663.  
  664. ;¤ ­­ë¥ ¤«ï ¨­¨æ¨ «¨§ æ¨¨ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
  665. align 4
  666. vox_new_data:
  667.         db 2,0,0,0
  668.         db 0,1,2,3, 4,5,6,7 ;default table
  669.         dd 0 ;null node
  670.  
  671. ;¨­¨æ¨ «¨§ æ¨ï ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
  672. align 4
  673. proc but_new_file uses ecx edi esi, file_data:dword
  674.         mov ecx,vox_offs_data+4
  675.         mov esi,vox_new_data
  676.         mov edi,[file_data]
  677.         cld
  678.         rep movsb
  679.         ret
  680. endp
  681.  
  682. align 4
  683. open_file_vox dd 0 ;㪠§ â¥«ì ­  ®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  684. moved_file_vox dd 0
  685.  
  686. align 4
  687. but_open_file:
  688.         pushad
  689.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  690.         mov [OpenDialog_data.type],0
  691.         stdcall [OpenDialog_Start],OpenDialog_data
  692.         cmp [OpenDialog_data.status],2
  693.         je .end_open_file
  694.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  695.  
  696.         mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  697.         mov [run_file_70.Function], 0
  698.         mov [run_file_70.Position], 0
  699.         mov [run_file_70.Flags], 0
  700.         m2m dword[run_file_70.Count], dword[max_open_file_size]
  701.         m2m [run_file_70.Buffer], [open_file_vox]
  702.         mov byte[run_file_70+20], 0
  703.         mov dword[run_file_70.FileName], openfile_path
  704.         mov ebx,run_file_70
  705.         int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  706.         cmp ebx,0xffffffff
  707.         je .end_open_file
  708.  
  709.         ;add ebx,[open_file_vox]
  710.         ;mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
  711.         mcall 71,1,openfile_path
  712.  
  713.         ;---
  714.         mov eax,[open_file_vox]
  715.         movzx eax,byte[eax]
  716.         and eax,0xff ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  717.         mov dword[v_zoom],eax ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  718.         mov dword[cam_x],0
  719.         mov dword[cam_y],0
  720.         mov dword[cam_z],0
  721.         call draw_objects
  722.         .end_open_file:
  723.         popad
  724.         ret
  725.  
  726. align 4
  727. but_save_file:
  728.         pushad
  729.                 copy_path open_dialog_name,communication_area_default_path,file_name,0
  730.                 mov [OpenDialog_data.type],1
  731.                 stdcall [OpenDialog_Start],OpenDialog_data
  732.                 cmp [OpenDialog_data.status],2
  733.                 je .end_save_file
  734.                 ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  735.  
  736.                 mov eax,dword[v_zoom] ;§ ¤ ¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  737.                 mov ebx,[moved_file_vox]
  738.                 mov byte[ebx],al
  739.  
  740.                 stdcall buf2d_vox_obj_get_size, ebx
  741.                 mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
  742.                 mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
  743.                 mov [run_file_70.Function], 2
  744.                 mov [run_file_70.Position], 0
  745.                 mov [run_file_70.Flags], 0
  746.                 mov ebx, dword[moved_file_vox]
  747.                 mov [run_file_70.Buffer], ebx
  748.                 mov byte[run_file_70+20], 0
  749.                 mov dword[run_file_70.FileName], openfile_path
  750.                 mov ebx,run_file_70
  751.                 int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
  752.                 cmp ebx,0xffffffff
  753.                 je .end_save_file
  754.  
  755.                 .end_save_file:
  756.         popad
  757.         ret
  758.  
  759. ;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
  760. align 4
  761. but_zoom_p:
  762.         cmp dword[v_zoom],10 ;¬ ªá¨¬ «ì­ë© à §¬¥à, ¤® ª®â®à®£® ¬®¦­® 㢥«¨ç¨âì 2^10=1024
  763.         jge @f
  764.                 inc dword[v_zoom]
  765.                 shl dword[n_plane],1
  766.                 push eax
  767.                 mov eax,[v_zoom]
  768.                 cmp eax,[scaled_zoom]
  769.                 jl .end_0
  770.                         push ecx
  771.                         mov ecx,[scaled_zoom]
  772.                         xor eax,eax
  773.                         inc eax
  774.                         shl eax,cl
  775.                         shl dword[cam_x],1
  776.                         shl dword[cam_y],1
  777.                         shl dword[cam_z],1
  778.                         cmp eax,[n_plane]
  779.                         jg .end_1
  780.                                 ;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
  781.                                 sub [n_plane],eax
  782.                                 inc dword[cam_y]
  783.                         .end_1:
  784.                         pop ecx
  785.                 .end_0:
  786.                 pop eax
  787.                 call draw_objects
  788.                 call draw_pok
  789.         @@:
  790.         ret
  791.  
  792. ;㬥­ì襭¨¥ ¬ áèâ ¡ 
  793. align 4
  794. but_zoom_m:
  795.         cmp dword[v_zoom],1
  796.         jl @f
  797.                 dec dword[v_zoom]
  798.                 shr dword[n_plane],1
  799.                 push eax
  800.                 mov eax,[v_zoom]
  801.                 cmp eax,[scaled_zoom]
  802.                 jl .end_0
  803.                         shr dword[cam_x],1
  804.                         shr dword[cam_y],1
  805.                         jnc .end_1
  806.                                 ;ª®à¥ªâ¨à®¢ª  ¯®«§ã­ª 
  807.                                 push ecx
  808.                                 mov ecx,[scaled_zoom]
  809.                                 dec ecx
  810.                                 xor eax,eax
  811.                                 inc eax
  812.                                 shl eax,cl
  813.                                 add [n_plane],eax
  814.                                 pop ecx
  815.                         .end_1:
  816.                         shr dword[cam_z],1
  817.                 .end_0:
  818.                 pop eax
  819.                 call draw_objects
  820.                 call draw_pok
  821.         @@:
  822.         ret
  823.  
  824. align 4
  825. but_3:
  826.         stdcall vox_obj_rot_z, [open_file_vox]
  827.         call draw_objects
  828.         ret
  829.  
  830. align 4
  831. but_4:
  832.         stdcall vox_obj_rot_x, [open_file_vox]
  833.         call draw_objects
  834.         ret
  835.  
  836. ;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
  837. align 4
  838. but_plane_inc:
  839. push eax ecx
  840.         inc dword[n_plane]
  841.         mov eax,[v_zoom]
  842.         cmp eax,[scaled_zoom]
  843.         jle .end_0
  844.                 ;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
  845.                 mov ecx,[scaled_zoom]
  846.                 xor eax,eax
  847.                 inc eax
  848.                 shl eax,cl
  849.                 cmp eax,[n_plane]
  850.                 jg @f
  851.                         mov dword[n_plane],0
  852.                         inc dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
  853.                         neg ecx
  854.                         ;inc ecx
  855.                         add ecx,[v_zoom]
  856.                         xor eax,eax
  857.                         inc eax
  858.                         shl eax,cl
  859.                         cmp eax,[cam_y]
  860.                         jg @f
  861.                                 mov dword[cam_y],0 ;§ æ¨ª«¨¢ ¥¬ ¥á«¨ ¢ë«¥§«¨ §  ¯à¥¤¥«ë ¯®á«¥¤­¥£® ªã¡ 
  862.                 @@:
  863.                 jmp .end_1
  864.         .end_0:
  865.                 ;¬ áèâ ¡¨à®¢ ­¨¥ ­¥ ¯à®¨á室¨â
  866.                 mov ecx,eax
  867.                 xor eax,eax
  868.                 inc eax
  869.                 shl eax,cl
  870.                 cmp eax,[n_plane]
  871.                 jg .end_1
  872.                         mov dword[n_plane],0
  873.         .end_1:
  874.         call draw_objects
  875.         call draw_pok
  876. pop ecx eax
  877.         ret
  878.  
  879. ;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
  880. align 4
  881. but_plane_dec:
  882.         dec dword[n_plane]
  883.         cmp dword[n_plane],0
  884.         jge .end_f
  885. push eax ecx
  886.         mov ecx,[scaled_zoom]
  887.         xor eax,eax
  888.         inc eax
  889.         shl eax,cl
  890.         dec eax
  891.         mov dword[n_plane],eax
  892.  
  893.         mov eax,[v_zoom]
  894.         cmp eax,[scaled_zoom]
  895.         jle .end_0
  896.                 ;¯à®¨á室¨â ¬ áèâ ¡¨à®¢ ­¨¥
  897.                 dec dword[cam_y] ;¯¥à¥å®¤¨¬ ¢ á®á¥¤­¨© ªã¡
  898.                 cmp dword[cam_y],0
  899.                 jge .end_0
  900.  
  901.                 mov ecx,eax
  902.                 sub ecx,[scaled_zoom]
  903.                 xor eax,eax
  904.                 inc eax
  905.                 shl eax,cl
  906.                 dec eax
  907.                 mov dword[cam_y],eax ;¥á«¨ ­®¬¥à ªã¡  ®ª § «áï ¬¥­ìè¥ 0 ¨á¯à ¢«ï¥¬ ­  ¬ ªá¨¬ «ì­®¥ §­ ç¥­¨¥
  908.         .end_0:
  909. pop ecx eax
  910.         .end_f:
  911.         call draw_objects
  912.         call draw_pok
  913.         ret
  914.  
  915. align 4
  916. but_light:
  917.         xor dword[mode_light],1
  918.         call draw_objects
  919.         ret
  920.  
  921. align 4
  922. but_rend_2_2:
  923. push edi
  924.         cmp dword[buf_r_img],0
  925.         jne @f
  926.                 ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï ७¤¥à 
  927.                 push ecx esi
  928.                 mov edi,buf_r_img
  929.                 mov esi,buf_0
  930.                 mov ecx,BUF_STRUCT_SIZE
  931.                 cld
  932.                 rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
  933.                 mov edi,buf_r_img
  934.                 mov buf2d_data,0
  935.                 shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
  936.                 shl buf2d_h,1
  937.                 stdcall [buf2d_create],buf_r_img
  938.  
  939.                 mov edi,buf_r_z
  940.                 mov esi,buf_0z
  941.                 mov ecx,BUF_STRUCT_SIZE
  942.                 cld
  943.                 rep movsb ;ª®¯¨à㥬 ¢á¥ ¯ à ¬¥âàë á ®á­®¢­®£® ¡ãä¥à 
  944.                 mov edi,buf_r_z
  945.                 mov buf2d_data,0
  946.                 shl buf2d_w,1 ;㢥«¨ç¨¢ ¥¬ à §¬¥à ¡ãä¥à 
  947.                 shl buf2d_h,1
  948.                 stdcall [buf2d_create],buf_r_z
  949.                 pop esi ecx
  950.         @@:
  951.         stdcall [buf2d_clear], buf_r_img, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  952.         stdcall [buf2d_clear], buf_r_z, 0 ;ç¨á⨬ ¡ãä¥à
  953.  
  954.         push eax ebx ecx
  955.                 mov eax,[v_zoom]
  956.                 cmp eax,[scaled_zoom]
  957.                 jle .end_scaled
  958.                         ;७¤¥à 㢥«¨ç¥­­®© ç á⨠®¡ê¥ªâ 
  959.                         mov ebx,[scaled_zoom]
  960.                         sub eax,ebx
  961.                         inc ebx
  962.                         stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, buf_vox,\
  963.                                 [open_file_vox], 0,0, 0, ebx, [cam_x],[cam_y],[cam_z],eax, [sc.work_graph]
  964.                         bt dword[mode_light],0
  965.                         jnc @f
  966.                                 stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, ebx, 3
  967.                         @@:
  968.                         xor ebx,ebx
  969.                         xor ecx,ecx
  970.                         mov edi,buf_r_img
  971.                         stdcall [buf2d_img_hdiv2], edi
  972.                         shr buf2d_h,1
  973.                         stdcall [buf2d_img_wdiv2], edi
  974.                         shr buf2d_w,1
  975.                         jmp .show
  976.                 .end_scaled:
  977.  
  978.                 inc eax
  979.                 stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, buf_vox, [open_file_vox], 0,0, 0, eax
  980.                 stdcall [buf2d_vox_obj_draw_1g], buf_r_img, buf_r_z, [open_file_vox], 0,0, eax
  981.                 bt dword[mode_light],0
  982.                 jnc @f
  983.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, eax, 3
  984.                 @@:
  985.  
  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.  
  992.                 stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
  993.                 mov ebx,[buf_0.w]
  994.                 sub ebx,eax
  995.                 shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
  996.                 stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
  997.                 cmp eax,[buf_0.h]
  998.                 jg @f
  999.                         mov ecx,[buf_0.h]
  1000.                         sub ecx,eax
  1001.                         shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
  1002.                 @@:
  1003.                 .show:
  1004.                 stdcall [buf2d_bit_blt], buf_0, ebx,ecx, edi
  1005.                 shl buf2d_h,1
  1006.                 shl buf2d_w,1
  1007.         pop ecx ebx eax
  1008. pop edi
  1009.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1010.         ret
  1011.  
  1012. align 4
  1013. but_move:
  1014. push eax
  1015.         stdcall but_new_file, [moved_file_vox]
  1016.         mov eax,[v_zoom]
  1017.         stdcall buf_vox_obj_recreat, [open_file_vox], [moved_file_vox],\
  1018.                 [mov_x],[mov_y],[mov_z], eax
  1019.  
  1020.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1021.         stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
  1022.         cmp eax,[scaled_zoom]
  1023.         jle @f
  1024.                 mov eax,[scaled_zoom]
  1025.         @@:
  1026.         stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox, [moved_file_vox],              0,0,0, eax
  1027. pop eax
  1028.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1029.         ret
  1030.  
  1031. ;description:
  1032. ; äã­ªæ¨ï à¨áãîé ï ¢®ªá¥«ì­ë© ®¡ê¥ªâ (¢¨¤­® 3 £à ­¨)
  1033. ;input:
  1034. ; v_obj - ¢®ªá¥«ì­ë© ®¡ê¥ªâ
  1035. ; k_scale - ª®íä. ¤«ï ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  1036. align 4
  1037. proc buf_vox_obj_recreat, v_obj:dword, obj_n:dword,\
  1038. coord_x:dword, coord_y:dword, coord_z:dword, k_scale:dword
  1039. pushad
  1040.         mov edi,[v_obj]
  1041.         mov ecx,[k_scale]
  1042.         mov ebx,[coord_x]
  1043.         mov edx,[coord_y]
  1044.         add edi,vox_offs_data
  1045.         mov esi,[coord_z]
  1046.         stdcall vox_go_in_node, [v_obj], [obj_n]
  1047. popad
  1048.         ret
  1049. endp
  1050.  
  1051. ;input:
  1052. ; ebx - coord_x
  1053. ; edx - coord_y
  1054. ; esi - coord_z
  1055. ; ecx - ã஢¥­ì ⥪ã襣® 㧫 
  1056. ; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
  1057. align 4
  1058. proc vox_go_in_node, v_obj:dword, obj_n:dword
  1059.         cmp byte[edi+3],0 ;ᬮâਬ ¥áâì «¨ ¯®¤¤¥à¥¢ìï
  1060.         je .sub_trees
  1061.                 ;४ãàᨢ­ë© ¯¥à¥¡®à ¯®¤¤¥à¥¢ì¥¢
  1062.                 push eax edx
  1063.  
  1064.                 ;¯à®à¨á®¢ª  à ¬ª¨ ¥á«¨ à §¬¥à 㧫  = 1
  1065.                 cmp ecx,0
  1066.                 jne @f
  1067.                         stdcall buf2d_vox_obj_create_node, [obj_n], ebx,edx,esi, [v_zoom], [edi]
  1068.                 @@:
  1069.  
  1070.                 ;¢å®¤ ¢­ãâàì 㧫 
  1071.                 dec ecx
  1072.                 mov ah,byte[edi+3]
  1073.                 add edi,4
  1074.                 mov al,8
  1075.                 .cycle:
  1076.                         bt ax,8 ;â¥áâ¨à㥬 ⮫쪮 ah
  1077.                         jnc .c_next
  1078.                                 push ebx edx esi
  1079.                                 stdcall vox_corect_coords, [v_obj]
  1080.                                 stdcall vox_go_in_node, [v_obj], [obj_n]
  1081.                                 pop esi edx ebx
  1082.                         .c_next:
  1083.                         shr ah,1
  1084.                         dec al
  1085.                         jnz .cycle
  1086.  
  1087.                 ;¢ë室 ¨§ 㧫 
  1088.                 inc ecx
  1089.                 pop edx eax
  1090.  
  1091.                 jmp .end_f
  1092.         .sub_trees:
  1093.                 ;à¨á㥬 㧥«
  1094.                 cmp ecx,0
  1095.                 jne @f
  1096.                         stdcall buf2d_vox_obj_create_node, [obj_n], ebx,edx,esi, [v_zoom], [edi]
  1097.                 @@:
  1098.  
  1099.                 add edi,4
  1100.         .end_f:
  1101.         ret
  1102. endp
  1103.  
  1104. ;description:
  1105. ;äã­ªæ¨ï ¤«ï ª®à¥ªâ¨à®¢ª¨ ª®®à¤¨­ â
  1106. ;­ ¯à ¢«¥­¨ï ®á¥© ª®®à¤¨­ â ¢ ¢®ªá¥«¥:
  1107. ;*z
  1108. ;|
  1109. ;+
  1110. ;  * y
  1111. ; /
  1112. ;+
  1113. ; \
  1114. ;  * x
  1115. ;input:
  1116. ;  al - ­®¬¥à 㧫  ¢ ¤¥à¥¢¥ (®â 1 ¤® 8)
  1117. ; ebx - ª®®à¤¨­ â  x
  1118. ; edx - ª®®à¤¨­ â  y
  1119. ; esi - ª®®à¤¨­ â  z
  1120. ; ecx - ã஢¥­ì ⥪ã襣® 㧫 
  1121. ;output:
  1122. ; ebx - ­®¢ ï ª®®à¤¨­ â  x
  1123. ; edx - ­®¢ ï ª®®à¤¨­ â  y
  1124. ; esi - ­®¢ ï ª®®à¤¨­ â  z
  1125. align 4
  1126. proc vox_corect_coords, v_obj:dword
  1127.         cmp ecx,0
  1128.         jl .end_f ;¤«ï ã᪮७¨ï ®âà¨á®¢ª¨
  1129.  
  1130.         push eax edi
  1131.         and eax,15 ;¢ë¤¥«ï¥¬ ­®¬¥à 㧫  ¢ ¤¥à¥¢¥
  1132.         mov edi,[v_obj]
  1133.         add edi,vox_offs_tree_table
  1134.         add edi,8
  1135.         sub edi,eax
  1136.  
  1137.         xor eax,eax
  1138.         inc eax
  1139.         cmp ecx,1
  1140.         jl .no_scale ;¢® ¨§¡¥¦ ­¨¥ § æ¨ª«¨¢ ­¨ï
  1141.                 shl eax,cl
  1142.         .no_scale:
  1143.  
  1144.         bt word[edi],0 ;test voxel coord x
  1145.         jnc @f
  1146.                 add ebx,eax
  1147.         @@:
  1148.         bt word[edi],1 ;test voxel coord y
  1149.         jnc @f
  1150.                 add edx,eax
  1151.         @@:
  1152.         bt word[edi],2 ;test voxel coord z
  1153.         jnc @f
  1154.                 add esi,eax
  1155.         @@:
  1156.         pop edi eax
  1157.         .end_f:
  1158.         ret
  1159. endp
  1160.  
  1161. align 4
  1162. v_zoom dd 3 ;⥪ã騩 ¬ áèâ ¡
  1163. v_cur_x dd 0 ;ª®®à¤¨­ â  ªãàá®à  x
  1164. v_cur_y dd 0 ;ª®®à¤¨­ â  ªãàá®à  y (­® ®áì ¢ ®¡ê¥ªâ¥ z)
  1165. n_plane dd 0 ;¯«®áª®áâì á¥ç¥­¨ï
  1166. v_color dd 0xff ;梥⠪ à ­¤ è 
  1167. mode_light dd 1 ;०¨¬ ®á¢¥é¥­¨ï
  1168. cam_x dd 0
  1169. cam_y dd 0
  1170. cam_z dd 0
  1171. ;ᤢ¨£¨ ®¡ê¥ªâ  ¯à¨ ¯¥à¥á®§¤ ­¨¨ (¯¥à¥¤¢¨¦¥­¨¨)
  1172. mov_x dd 0
  1173. mov_y dd 0
  1174. mov_z dd 0
  1175. scaled_zoom dd 5 ;¬ áèâ ¡ ¯®á«¥ ª®â®à®£® ­ ç¨­ ¥âáï à¨á®¢ ­¨¥ ç á⨠¨§®¡à ¦¥­¨ï
  1176. tile_size dd ? ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á á¥ç¥­¨¥¬
  1177. max_open_file_size dd ?
  1178. brush_w dd 5 ;è¨à¨­  ª¨áâ¨
  1179. brush_h dd 5 ;¢ëá®â  ª¨áâ¨
  1180. brush_data dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
  1181. dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
  1182. dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
  1183. dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
  1184. dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
  1185. rd 999 ;32*32-25
  1186.  
  1187. txt_zoom db 'Œ áèâ ¡:',0
  1188. txt_curor: db 'Šãàá®à: '
  1189. .size: rb 10
  1190. txt_n_plane db '‘¥ç¥­¨¥:',0
  1191. txt_color db '–¢¥â:',0
  1192. txt_mov_offs: db '‘¬¥é¥­¨¥: '
  1193. .size: rb 30
  1194. txt_mull db '*',0
  1195. txt_space db ' ',0
  1196. txt_buf rb 16
  1197.  
  1198. align 4
  1199. draw_objects:
  1200.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  1201.         stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
  1202.         stdcall [buf2d_clear], buf_pl, [buf_pl.color] ;ç¨á⨬ ¡ãä¥à
  1203.  
  1204.         push eax ebx ecx
  1205.         stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
  1206.         mov ebx,[buf_0.w]
  1207.         sub ebx,eax
  1208.         shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
  1209.  
  1210.         xor ecx,ecx
  1211.         stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
  1212.         cmp eax,[buf_0.h]
  1213.         jg @f
  1214.                 mov ecx,[buf_0.h]
  1215.                 sub ecx,eax
  1216.                 shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯®
  1217.         @@:
  1218.  
  1219.         mov eax,[v_zoom]
  1220.         cmp eax,[scaled_zoom]
  1221.         jg @f
  1222.                 ;®¡ëç­ë© ०¨¬ ¨§®¡à ¦¥­¨ï
  1223.                 stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox,\
  1224.                         [open_file_vox], ebx,ecx, 0, eax
  1225.                 stdcall [buf2d_vox_obj_draw_pl], buf_pl, [open_file_vox],\
  1226.                         OT_MAP_X,OT_MAP_Y,[tile_size], eax, [n_plane], [sc.work_graph]
  1227.                 stdcall [buf2d_vox_obj_draw_1g], buf_0, buf_0z,\
  1228.                         [open_file_vox], 0,0, eax
  1229.                 bt dword[mode_light],0
  1230.                 jnc .end_1
  1231.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, ebx,ecx, 0, eax, 3
  1232.                 .end_1:
  1233.                 jmp .end_0
  1234.         @@:
  1235.                 ;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
  1236.                 sub eax,[scaled_zoom]
  1237.                 stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, buf_vox,\
  1238.                         [open_file_vox], 0,0, 0, [scaled_zoom], [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] ;scroll -> 2^eax
  1239.                 stdcall [buf2d_vox_obj_draw_pl_scaled], buf_pl, [open_file_vox],\
  1240.                         OT_MAP_X,OT_MAP_Y,[tile_size], [scaled_zoom], [n_plane], [sc.work_graph],[cam_x],[cam_y],[cam_z],eax
  1241.                 bt dword[mode_light],0
  1242.                 jnc .end_2
  1243.                         stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, 0,0, 0, [scaled_zoom], 3
  1244.                 .end_2:
  1245.         .end_0:
  1246.         pop ecx ebx eax
  1247.  
  1248.         call draw_vox_cursor
  1249.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1250.         stdcall [buf2d_draw], buf_pl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  1251.         .end_f:
  1252.         ret
  1253.  
  1254. ;à¨á®¢ ­¨¥ ªãàá®à 
  1255. align 4
  1256. draw_vox_cursor:
  1257. pushad
  1258.         mov ecx,[v_zoom]
  1259.         cmp ecx,[scaled_zoom]
  1260.         jle @f
  1261.                 mov ecx,[scaled_zoom]
  1262.         @@:
  1263.         xor edx,edx
  1264.         inc edx
  1265.         shl edx,cl
  1266.  
  1267.         mov eax,[v_cur_x]
  1268.         cmp eax,edx
  1269.         jge .end_f ;ªãàá®à §  ¯à¥¤¥« ¬¨ ¯®«ï
  1270.         mov edi,[tile_size]
  1271.         imul eax,edi
  1272.         add eax,OT_MAP_X
  1273.         mov ebx,edx
  1274.         dec ebx
  1275.         sub ebx,[v_cur_y]
  1276.         imul ebx,edi
  1277.         add ebx,OT_MAP_Y
  1278.         inc eax
  1279.         inc ebx
  1280.         sub edi,2
  1281.         stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,edi,[sc.work_graph]
  1282.         dec ebx
  1283.         add edi,2
  1284.  
  1285.         ;£®à¨§®­â «ì­ë¥ «¨­¨¨
  1286.         sub eax,2
  1287.         mov ecx,edi
  1288.         imul edi,edx
  1289.         shr ecx,1
  1290.         add ebx,ecx ;業â஢ª  ¯® á¥à¥¤¨­¥ ª«¥âª¨
  1291.         mov ecx,OT_MAP_X
  1292.         add edi,ecx
  1293.         stdcall [buf2d_line], buf_pl, ecx,ebx, eax,ebx,[sc.work_graph]
  1294.         add eax,[tile_size]
  1295.         inc eax
  1296.         cmp eax,edi
  1297.         jge @f ;¥á«¨ ªãàá®à ­  ªà î ¯®«ï
  1298.                 dec edi
  1299.                 stdcall [buf2d_line], buf_pl, eax,ebx, edi,ebx,[sc.work_graph]
  1300.         @@:
  1301.  
  1302.         .end_f:
  1303. popad
  1304.         ret
  1305.  
  1306.  
  1307. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  1308. align 4
  1309. OpenDialog_data:
  1310. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  1311. .procinfo               dd procinfo     ;+4
  1312. .com_area_name          dd communication_area_name      ;+8
  1313. .com_area               dd 0    ;+12
  1314. .opendir_path           dd plugin_path  ;+16
  1315. .dir_default_path       dd default_dir ;+20
  1316. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  1317. .draw_window            dd draw_window  ;+28
  1318. .status                 dd 0    ;+32
  1319. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  1320. .filename_area          dd filename_area        ;+40
  1321. .filter_area            dd Filter
  1322. .x:
  1323. .x_size                 dw 420 ;+48 ; Window X size
  1324. .x_start                dw 10 ;+50 ; Window X position
  1325. .y:
  1326. .y_size                 dw 320 ;+52 ; Window y size
  1327. .y_start                dw 10 ;+54 ; Window Y position
  1328.  
  1329. default_dir db '/rd/1',0
  1330.  
  1331. communication_area_name:
  1332.         db 'FFFFFFFF_open_dialog',0
  1333. open_dialog_name:
  1334.         db 'opendial',0
  1335. communication_area_default_path:
  1336.         db '/rd/1/File managers/',0
  1337.  
  1338. Filter:
  1339. dd Filter.end - Filter ;.1
  1340. .1:
  1341. db 'VOX',0
  1342. .end:
  1343. db 0
  1344.  
  1345.  
  1346.  
  1347. head_f_i:
  1348. head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  1349.  
  1350. system_dir_0 db '/sys/lib/'
  1351. lib_name_0 db 'proc_lib.obj',0
  1352. err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  1353. err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  1354.  
  1355. system_dir_1 db '/sys/lib/'
  1356. lib_name_1 db 'libimg.obj',0
  1357. err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  1358. err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  1359.  
  1360. system_dir_2 db '/sys/lib/'
  1361. lib_name_2 db 'buf2d.obj',0
  1362. err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
  1363. err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
  1364.  
  1365. system_dir_3 db '/sys/lib/'
  1366. lib_name_3 db 'libini.obj',0
  1367. err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
  1368. err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini',39,0
  1369.  
  1370. l_libs_start:
  1371.         lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  1372.                 err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
  1373.         lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  1374.                 err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
  1375.         lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
  1376.                 err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
  1377.         lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
  1378.                 err_msg_found_lib_3,head_f_l,import_libini,err_msg_import_3,head_f_i
  1379. l_libs_end:
  1380.  
  1381. align 4
  1382. import_libimg:
  1383.         dd alib_init1
  1384.         img_is_img  dd aimg_is_img
  1385.         img_info    dd aimg_info
  1386.         img_from_file dd aimg_from_file
  1387.         img_to_file dd aimg_to_file
  1388.         img_from_rgb dd aimg_from_rgb
  1389.         img_to_rgb  dd aimg_to_rgb
  1390.         img_to_rgb2 dd aimg_to_rgb2
  1391.         img_decode  dd aimg_decode
  1392.         img_encode  dd aimg_encode
  1393.         img_create  dd aimg_create
  1394.         img_destroy dd aimg_destroy
  1395.         img_destroy_layer dd aimg_destroy_layer
  1396.         img_count   dd aimg_count
  1397.         img_lock_bits dd aimg_lock_bits
  1398.         img_unlock_bits dd aimg_unlock_bits
  1399.         img_flip    dd aimg_flip
  1400.         img_flip_layer dd aimg_flip_layer
  1401.         img_rotate  dd aimg_rotate
  1402.         img_rotate_layer dd aimg_rotate_layer
  1403.         img_draw    dd aimg_draw
  1404.  
  1405.         dd 0,0
  1406.         alib_init1   db 'lib_init',0
  1407.         aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
  1408.         aimg_info    db 'img_info',0
  1409.         aimg_from_file db 'img_from_file',0
  1410.         aimg_to_file db 'img_to_file',0
  1411.         aimg_from_rgb db 'img_from_rgb',0
  1412.         aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
  1413.         aimg_to_rgb2 db 'img_to_rgb2',0
  1414.         aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
  1415.         aimg_encode  db 'img_encode',0
  1416.         aimg_create  db 'img_create',0
  1417.         aimg_destroy db 'img_destroy',0
  1418.         aimg_destroy_layer db 'img_destroy_layer',0
  1419.         aimg_count   db 'img_count',0
  1420.         aimg_lock_bits db 'img_lock_bits',0
  1421.         aimg_unlock_bits db 'img_unlock_bits',0
  1422.         aimg_flip    db 'img_flip',0
  1423.         aimg_flip_layer db 'img_flip_layer',0
  1424.         aimg_rotate  db 'img_rotate',0
  1425.         aimg_rotate_layer db 'img_rotate_layer',0
  1426.         aimg_draw    db 'img_draw',0
  1427.  
  1428. align 4
  1429. proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  1430.         OpenDialog_Init dd aOpenDialog_Init
  1431.         OpenDialog_Start dd aOpenDialog_Start
  1432. dd 0,0
  1433.         aOpenDialog_Init db 'OpenDialog_init',0
  1434.         aOpenDialog_Start db 'OpenDialog_start',0
  1435.  
  1436. align 4
  1437. import_buf2d:
  1438.         init dd sz_init
  1439.         buf2d_create dd sz_buf2d_create
  1440.         buf2d_create_f_img dd sz_buf2d_create_f_img
  1441.         buf2d_clear dd sz_buf2d_clear
  1442.         buf2d_draw dd sz_buf2d_draw
  1443.         buf2d_delete dd sz_buf2d_delete
  1444.         buf2d_line dd sz_buf2d_line
  1445.         buf2d_rect_by_size dd sz_buf2d_rect_by_size
  1446.         buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
  1447.         buf2d_circle dd sz_buf2d_circle
  1448.         buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
  1449.         buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
  1450.         buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
  1451.         buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
  1452.         buf2d_bit_blt dd sz_buf2d_bit_blt
  1453.         buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
  1454.         buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
  1455.         buf2d_curve_bezier dd sz_buf2d_curve_bezier
  1456.         buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
  1457.         buf2d_draw_text dd sz_buf2d_draw_text
  1458.         buf2d_crop_color dd sz_buf2d_crop_color
  1459.         buf2d_offset_h dd sz_buf2d_offset_h
  1460.         buf2d_flood_fill dd sz_buf2d_flood_fill
  1461.         buf2d_set_pixel dd sz_buf2d_set_pixel
  1462.         buf2d_get_pixel dd sz_buf2d_get_pixel
  1463.         buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
  1464.         buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
  1465.         buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
  1466.         buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
  1467.         buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
  1468.         buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
  1469.         buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
  1470.         buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
  1471.         buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
  1472.         buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
  1473.  
  1474.         dd 0,0
  1475.         sz_init db 'lib_init',0
  1476.         sz_buf2d_create db 'buf2d_create',0
  1477.         sz_buf2d_create_f_img db 'buf2d_create_f_img',0
  1478.         sz_buf2d_clear db 'buf2d_clear',0
  1479.         sz_buf2d_draw db 'buf2d_draw',0
  1480.         sz_buf2d_delete db 'buf2d_delete',0
  1481.         sz_buf2d_line db 'buf2d_line',0
  1482.         sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
  1483.         sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
  1484.         sz_buf2d_circle db 'buf2d_circle',0
  1485.         sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
  1486.         sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
  1487.         sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
  1488.         sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
  1489.         sz_buf2d_bit_blt db 'buf2d_bit_blt',0
  1490.         sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
  1491.         sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
  1492.         sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
  1493.         sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
  1494.         sz_buf2d_draw_text db 'buf2d_draw_text',0
  1495.         sz_buf2d_crop_color db 'buf2d_crop_color',0
  1496.         sz_buf2d_offset_h db 'buf2d_offset_h',0
  1497.         sz_buf2d_flood_fill db 'buf2d_flood_fill',0
  1498.         sz_buf2d_set_pixel db 'buf2d_set_pixel',0
  1499.         sz_buf2d_get_pixel db 'buf2d_get_pixel',0
  1500.         sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
  1501.         sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
  1502.         sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
  1503.         sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
  1504.         sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
  1505.         sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
  1506.         sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
  1507.         sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
  1508.         sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
  1509.         sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
  1510.  
  1511. align 4
  1512. import_libini:
  1513.         dd alib_init2
  1514.         ini_get_str   dd aini_get_str
  1515.         ini_get_int   dd aini_get_int
  1516.         ini_get_color dd aini_get_color
  1517. dd 0,0
  1518.         alib_init2     db 'lib_init',0
  1519.         aini_get_str   db 'ini_get_str',0
  1520.         aini_get_int   db 'ini_get_int',0
  1521.         aini_get_color db 'ini_get_color',0
  1522.  
  1523. mouse_dd dd 0x0
  1524. sc system_colors
  1525.  
  1526. align 16
  1527. procinfo process_information
  1528.  
  1529. ;¡ãä¥à ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
  1530. align 4
  1531. buf_0: dd 0 ;㪠§ â¥«ì ­  ¤a­ë¥ ¨§®¡à ¦¥­¨ï
  1532. .l: dw 5 ;+4 left
  1533. .t: dw 45 ;+6 top
  1534. .w: dd 192+6 ;+8 w
  1535. .h: dd 224+7 ;+12 h
  1536. .color: dd 0xffffff ;+16 color
  1537.         db 24 ;+20 bit in pixel
  1538.  
  1539. ;¡ãä¥à £«ã¡¨­ë ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
  1540. align 4
  1541. buf_0z: dd 0
  1542.         dw 0 ;+4 left
  1543.         dw 0 ;+6 top
  1544. .w: dd 192+6 ;+8 w
  1545. .h: dd 224+7 ;+12 h
  1546. .color: dd 0 ;+16 color
  1547.         db 32 ;+20 bit in pixel
  1548.  
  1549. ;¡ãä¥à ¤«ï à¨á®¢ ­¨ï á१  ®¡ê¥ªâ 
  1550. align 4
  1551. buf_pl: dd 0
  1552. .l: dw 15+192+6 ;+4 left
  1553. .t: dw 45 ;+6 top
  1554. .w: dd 320 ;+8 w
  1555. .h: dd 330 ;+12 h
  1556. .color: dd 0xffffff ;+16 color
  1557.         db 24 ;+20 bit in pixel
  1558.  
  1559. ;¡ãä¥à ¤«ï ã«ãç襭®£® ७¤¥à 
  1560. align 4
  1561. buf_r_img:
  1562.         rb BUF_STRUCT_SIZE
  1563. align 4
  1564. buf_r_z:
  1565.         rb BUF_STRUCT_SIZE
  1566.  
  1567. align 4
  1568. cursor_pointer dd 0 ;㪠§ â¥«ì ­  ¤ ­­ë¥ ¤«ï ªãàá®à 
  1569.  
  1570.  
  1571. ;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
  1572. align 4
  1573. vox_6_7_z:
  1574. dd 0,0,1,1,0,0,\
  1575.    0,2,2,2,2,0,\
  1576.    2,2,2,2,2,2,\
  1577.    2,3,2,2,3,2,\
  1578.    2,3,3,3,3,2,\
  1579.    0,3,3,3,3,0,\
  1580.    0,0,3,3,0,0
  1581.  
  1582. align 4
  1583. buf_vox:
  1584.         db 6,7,4,3 ;w,h,h_osn,n
  1585.         rb BUF_STRUCT_SIZE*(3+1)
  1586.  
  1587. align 16
  1588. i_end:
  1589.         wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
  1590.                 rq 0
  1591.         rb 4096 ;2048
  1592. stacktop:
  1593.         sys_path rb 1024
  1594.         file_name:
  1595.                 rb 1024 ;4096
  1596.         library_path rb 1024
  1597.         plugin_path rb 1024 ;4096
  1598.         openfile_path rb 1024 ;4096
  1599.         filename_area rb 256
  1600. mem:
  1601.