Subversion Repositories Kolibri OS

Rev

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

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