Subversion Repositories Kolibri OS

Rev

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

  1. ;
  2. ; ¢ í⮬ ä ©«¥ ᮡ࠭ë ä㭪樨 ­ã¦­ë¥ ¤«ï ᮧ¤ ­¨ï ¨
  3. ; à ¡®âë ®ª­  á ª®®à¤¨­ â ¬¨ ¢¥à設
  4. ;
  5.  
  6. prop_wnd_width  equ 340 ;è¨à¨­  ®ª­  ᮠ᢮©á⢠¬¨ ®¡ê¥ªâ 
  7. prop_wnd_height equ 460 ;¢ëá®â  ®ª­  ᮠ᢮©á⢠¬¨ ®¡ê¥ªâ 
  8. 3d_wnd_l equ   5 ;®âáâ㯠¤«ï tinygl ¡ãä¥à  á«¥¢ 
  9. 3d_wnd_t equ  23 ;®âáâ㯠¤«ï tinygl ¡ãä¥à  ᢥàåã
  10. 3d_wnd_w equ 320
  11. 3d_wnd_h equ 240
  12. SIZE_ONE_FLOAT equ 14
  13. MAX_OBJECT_SIZE equ (4+SIZE_ONE_FLOAT*3+1)
  14.  
  15. prop_wnd_run db 0 ;¯¥à¥¬¥­­ ï á«¥¤ïé ï §  ⥬ çâ®-¡ë ­¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª­  ᮠ᢮©á⢠¬¨ ®¤­®¢à¥¬¥­­®
  16.  
  17. txt_q db '?',0
  18. txt_space:
  19.         db SIZE_ONE_FLOAT dup(' ')
  20. .end:
  21.         db 0
  22.  
  23. obj_point: ;¤®¡ ¢«ï¥¬ë© ®¡ê¥ªâ
  24.         dd 0   ;㪠§ â¥«ì
  25. .text:
  26.         rb MAX_OBJECT_SIZE
  27.  
  28. if lang eq ru
  29. txt_select_vert: db '‚ë¡à ­®: '
  30. else
  31. txt_select_vert: db 'Select: '
  32. end if
  33. .count:
  34. dq 0,0
  35.  
  36. ;¤ ­®¥ ®ª­® (¯à®æ¥áá) ¢ë§ë¢ ¥âìáï ä㭪樥© but_wnd_coords
  37. align 4
  38. prop_start:
  39. pushad
  40.         mcall 40,0x27 ;¬ áª  ®¦¨¤ ¥¬ëå ᮡë⨩
  41.         inc byte[prop_wnd_run]
  42.         mov dword[w_scr_t3.type],1
  43.         mov edi,o3d
  44.         stdcall obj_clear_param, edi
  45.  
  46.         stdcall [tl_node_get_data],tree1
  47.         xor edx,edx
  48.         mov dword[capt_p],txt_q
  49.         cmp eax,0
  50.         je .no_points
  51.                 mov ebx,[eax] ;¯®«ãç ¥¬ §­ ç¥­¨¥ ᤢ¨£  ¢ë¡à ­­®£® ¡«®ª 
  52.                 add ebx,[open_file_data]
  53.  
  54.                 cmp word[ebx],CHUNK_OBJBLOCK
  55.                 jne .end_oblo
  56.                         mov dword[capt_p],txt_4000
  57.                         stdcall found_block_data, tree1
  58.                         cmp eax,0
  59.                         je .no_points
  60.                         mov esi,eax
  61.                         movzx ecx,byte[esi+2] ;cl - ã஢¥­ì ¢ë¡à ­­®£® 㧫 
  62.                         .cycle_0:
  63.                                 stdcall [tl_node_poi_get_next_info], tree1,esi
  64.                                 cmp eax,0
  65.                                 je .no_points
  66.                                 cmp byte[eax+2],cl
  67.                                 jle .no_points
  68.                                 mov esi,eax
  69.                                 stdcall [tl_node_poi_get_data], tree1,esi
  70.                                 mov ebx,[eax]
  71.                                 add ebx,[open_file_data]
  72.                                 cmp word[ebx],CHUNK_VERTLIST
  73.                                 je .ini_vlist
  74.                                 jmp .cycle_0
  75.                         jmp .no_points
  76.                 .end_oblo:
  77.                 cmp word[ebx],CHUNK_TRIMESH
  78.                 jne .end_trim
  79.                         mov dword[capt_p],txt_4100
  80.                         stdcall found_block_data, tree1
  81.                         cmp eax,0
  82.                         je .no_points
  83.                         mov esi,eax
  84.                         movzx ecx,byte[esi+2] ;cl - ã஢¥­ì ¢ë¡à ­­®£® 㧫 
  85.                         .cycle_1:
  86.                                 stdcall [tl_node_poi_get_next_info], tree1,esi
  87.                                 cmp eax,0
  88.                                 je .no_points
  89.                                 cmp byte[eax+2],cl
  90.                                 jle .no_points
  91.                                 mov esi,eax
  92.                                 stdcall [tl_node_poi_get_data], tree1,esi
  93.                                 mov ebx,[eax]
  94.                                 add ebx,[open_file_data]
  95.                                 cmp word[ebx],CHUNK_VERTLIST
  96.                                 je .ini_vlist
  97.                                 jmp .cycle_1
  98.                         jmp .no_points
  99.                 .end_trim:
  100.                 cmp word[ebx],CHUNK_VERTLIST
  101.                 jne .end_vlist
  102.                         mov dword[capt_p],txt_4110
  103.                         .ini_vlist:
  104.                         movzx edx,word[ebx+6] ;ª®««¨ç¥á⢮ â®ç¥ª
  105.                         add ebx,8
  106.                         ;¯®¨áª ¤ ­­ëå ¤«ï âà¥ã£®«ìª®¢
  107.                         stdcall found_block_data, tree1
  108.                         cmp eax,0
  109.                         je .set_points
  110.                         mov esi,eax
  111.                         ;¥á«¨ ­ è«¨ ¢ë¡à ­­ë© 㧥«, â® ¤ «¥¥ ¯ëâ ¥¬áï ­ ©â¨ 㧥« á âà¥ã£®«ì­¨ª ¬¨
  112.                         movzx ecx,byte[esi+2] ;cl - ã஢¥­ì ¢ë¡à ­­®£® 㧫 
  113.                         .cycle_2:
  114.                                 stdcall [tl_node_poi_get_next_info], tree1,esi
  115.                                 cmp eax,0
  116.                                 je .set_points
  117.                                 mov esi,eax
  118.                                 stdcall [tl_node_poi_get_data], tree1,esi
  119.                                 cmp byte[esi+2],cl
  120.                                 jl .set_points
  121.                                 je .found
  122.                                 jmp .cycle_2
  123.                         .found: ;¥á«¨ ­ è«¨ 㧥« ⮣®¦¥ ã஢­ï çâ® ¨ ¢ë¡à ­­ë© 㧥«
  124.                                 cmp eax,0
  125.                                 je .set_points
  126.                                 mov eax,[eax]
  127.                                 add eax,[open_file_data]
  128.                                 cmp word[eax],CHUNK_FACELIST
  129.                                 jne .cycle_2
  130.                                 movzx ecx,word[eax+6]
  131.                                 mov [edi+offs_obj_tri_count],ecx
  132.                                 add eax,8 ;2+4+2 (chunk+size+count)
  133.                                 mov [edi+offs_obj_tri_data],eax
  134.                         jmp .set_points
  135.                 .end_vlist:
  136.                 cmp word[ebx],CHUNK_TRACKPIVOT
  137.                 jne @f
  138.                         inc edx
  139.                         add ebx,6
  140.                         mov dword[capt_p],txt_b013
  141.                         jmp .set_points
  142.                 @@:
  143.                 cmp word[ebx],0xb014
  144.                 jne @f
  145.                         mov edx,2
  146.                         add ebx,6
  147.                         mov dword[capt_p],txt_b014
  148.                         ;jmp .set_points
  149.                 @@:
  150.                 .set_points:
  151.                 mov [edi+offs_obj_poi_data],ebx
  152.                 mov [edi+offs_obj_poi_count],edx
  153.         .no_points:
  154.  
  155.         ;­ áâனª  ᯨ᪠ ®¡ê¥ªâ®¢
  156.         mov dword[tree3.info_max_count],2
  157.         add dword[tree3.info_max_count],edx ;áâ ¢¨¬ ç¨á«® 㧫®¢, à ¢­®¥ ª®««¨ç¥áâ¢ã â®ç¥ª (+2 ­  ­ ç «® ¨ ª®­¥æ ᯨ᪠)
  158.         stdcall dword[tl_data_init], tree3
  159.         mov eax,dword[icon_tl_sys]
  160.         mov dword[tree3.data_img_sys],eax
  161.         mov eax,dword[icon_toolbar]
  162.         mov dword[tree3.data_img],eax
  163.  
  164.         cmp edx,0
  165.         je .no_object
  166.                 mov word[NumberSymbolsAD],5
  167.                 finit
  168.                 .new_point:
  169.                         mov dword[obj_point],ebx
  170.                         mov dword[obj_point.text],0
  171.                         cld
  172.                         mov ecx,3
  173.                         @@:
  174.                                 fld dword[ebx]
  175.                                 fstp qword[Data_Double]
  176.                                 call DoubleFloat_to_String
  177.                                 add ebx,4
  178.                                 stdcall str_len, Data_String
  179.                                 mov esi,txt_space
  180.                                 add esi,eax
  181.                                 cmp esi,txt_space.end
  182.                                 jl .normal_size
  183.                                         mov esi,txt_space.end-1 ;¬¨­¨¬ã¬ 1 ¯à®¡¥« ­ã¦­® ¤®¡ ¢¨âì, çâ®-¡ë æ¨äàë ­¥ ᫨¯ «¨áì
  184.                                 .normal_size:
  185.                                 stdcall str_cat, obj_point.text,esi
  186.                                 stdcall str_cat, obj_point.text,Data_String
  187.                                 loop @b
  188.                         stdcall dword[tl_node_add], tree3,(ID_ICON_POINT shl 16),obj_point
  189.                         stdcall dword[tl_cur_next], tree3
  190.                         dec edx
  191.                         cmp edx,0
  192.                         jg .new_point
  193.                         stdcall dword[tl_cur_beg], tree3
  194.         .no_object:
  195.         stdcall obj_set_sizes, o3d
  196.         stdcall obj_set_normals, o3d
  197.         edit_boxes_set_sys_color edit1,editboxes_end,sc ;ãáâ ­®¢ª  á¨á⥬­ëå 梥⮢
  198.         stdcall [edit_box_set_text], edit1, txt_q
  199.         stdcall [edit_box_set_text], edit2, txt_q
  200.         stdcall [edit_box_set_text], edit3, txt_q
  201.         mov eax,0xc0c0c0
  202.         mov ebx,[color_ox]
  203.         shr ebx,2
  204.         and ebx,0x3f3f3f
  205.         add eax,ebx
  206.         mov [edit1.color],eax
  207.         mov eax,0xc0c0c0
  208.         mov ebx,[color_oy]
  209.         shr ebx,2
  210.         and ebx,0x3f3f3f
  211.         add eax,ebx
  212.         mov [edit2.color],eax
  213.         mov eax,0xc0c0c0
  214.         mov ebx,[color_oz]
  215.         shr ebx,2
  216.         and ebx,0x3f3f3f
  217.         add eax,ebx
  218.         mov [edit3.color],eax
  219.  
  220.         mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
  221.         mov eax,[eax] ;eax -> ZBuffer
  222.         mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf
  223.         mov dword[buf_ogl],eax
  224. popad
  225.  
  226.         call prop_red_win
  227.  
  228. ;­¥ ®âà뢠âì íâã äã­ªæ¨î ®â ¯à¥¤ë¤ã饩
  229. align 4
  230. prop_still:
  231.         pushad
  232.  
  233.         mcall 23,10
  234.         or eax,eax
  235.         jnz @f
  236.                 call prop_timer_funct
  237.                 jmp .end
  238.         @@:
  239.  
  240.         cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
  241.         jne @f
  242.                 call prop_red_win
  243.                 jmp .end
  244.         @@:
  245.         cmp al,2
  246.         jne @f
  247.                 call prop_key
  248.                 jmp .end
  249.         @@:
  250.         cmp al,3
  251.         jz prop_button
  252.         cmp al,6
  253.         jne @f
  254.                 call prop_mouse
  255.         @@:
  256. .end:
  257.         popad
  258.         jmp prop_still
  259.  
  260. align 4
  261. prop_red_win:
  262. pushad
  263.         mcall 12,1
  264.  
  265.         xor eax,eax
  266.         mov edi,dword[capt_p] ;children window caption
  267.         mov bx,word[procinfo.box.left]
  268.         add bx,word[buf_0.l]
  269.         add bx,5 ;è¨à¨­  ¡®ª®¢®© à ¬ª¨
  270.         shl ebx,16
  271.         mov bx,prop_wnd_width
  272.         mov cx,word[procinfo.box.top]
  273.         add cx,word[buf_0.t]
  274.         shl ecx,16
  275.         mov cx,prop_wnd_height
  276.         mov edx,[sc.work]
  277.         or  edx,0x33000000
  278.         int 0x40
  279.  
  280.         mov esi,[sc.work_button]
  281.         mcall 8, (5 shl 16)+20, (266 shl 16)+20, 3
  282.         mcall , (30 shl 16)+20, (266 shl 16)+20, 4
  283.  
  284.         mov ebx,[image_data_toolbar]
  285.         add ebx,3*IMAGE_TOOLBAR_ICON_SIZE
  286.         mcall 7, , (16 shl 16)+16, (7 shl 16)+268 ;load
  287.  
  288.         sub ebx,IMAGE_TOOLBAR_ICON_SIZE
  289.         mov edx,(32 shl 16)+268 ;save
  290.         int 0x40
  291.  
  292.         mov dword[w_scr_t3.all_redraw],1
  293.         stdcall [scrollbar_ver_draw],dword w_scr_t3
  294.         stdcall [tl_draw], tree3
  295.         stdcall [edit_box_draw], edit1
  296.         stdcall [edit_box_draw], edit2
  297.         stdcall [edit_box_draw], edit3
  298.  
  299.         stdcall [kmainmenu_draw], [main_menu]
  300.         stdcall draw_3d, o3d
  301.         mcall 12,2
  302. popad
  303.         ret
  304.  
  305. align 4
  306. proc prop_key uses eax ebx
  307.         mcall 2
  308.  
  309.         test word [edit1.flags],10b ;ed_focus
  310.         je @f
  311.                 stdcall [edit_box_key], edit1
  312.                 jmp .end
  313.         @@:
  314.         test word [edit2.flags],10b
  315.         je @f
  316.                 stdcall [edit_box_key], edit2
  317.                 jmp .end
  318.         @@:
  319.         test word [edit3.flags],10b
  320.         je @f
  321.                 stdcall [edit_box_key], edit3
  322.                 jmp .end
  323.         @@:
  324.         cmp dword[el_focus], tree3
  325.         jne @f
  326.                 stdcall [tl_key], tree3
  327.                 jmp .end
  328.         @@:
  329.  
  330.         cmp ah,178 ;Up
  331.         jne @f
  332.                 fld dword[angle_x]
  333.                 fadd dword[delt_size]
  334.                 fstp dword[angle_x]
  335.                 stdcall draw_3d, o3d
  336.                 jmp .end
  337.         @@:
  338.         cmp ah,177 ;Down
  339.         jne @f
  340.                 fld dword[angle_x]
  341.                 fsub dword[delt_size]
  342.                 fstp dword[angle_x]
  343.                 stdcall draw_3d, o3d
  344.                 jmp .end
  345.         @@:
  346.         cmp ah,176 ;Left
  347.         jne @f
  348.                 fld dword[angle_y]
  349.                 fadd dword[delt_size]
  350.                 fstp dword[angle_y]
  351.                 stdcall draw_3d, o3d
  352.                 jmp .end
  353.         @@:
  354.         cmp ah,179 ;Right
  355.         jne @f
  356.                 fld dword[angle_y]
  357.                 fsub dword[delt_size]
  358.                 fstp dword[angle_y]
  359.                 stdcall draw_3d, o3d
  360.                 ;jmp .end
  361.         @@:
  362.         .end:
  363.         ret
  364. endp
  365.  
  366. align 4
  367. prop_mouse:
  368.         push eax ebx
  369.         mcall 37,3
  370.         bt eax,0
  371.         jnc .end_m
  372.                 ;mouse l. but. move
  373.                 cmp dword[mouse_drag],1
  374.                 jne .end_m
  375.                 mcall 37,1 ;get mouse coords
  376.                 mov ebx,eax
  377.                 shr ebx,16 ;mouse.x
  378.                 cmp ebx,3d_wnd_l
  379.                 jg @f
  380.                         mov ebx,3d_wnd_l
  381.                 @@:
  382.                 sub ebx,3d_wnd_l
  383.                 cmp ebx,3d_wnd_w
  384.                 jle @f
  385.                         mov ebx,3d_wnd_w
  386.                 @@:
  387.                 and eax,0xffff ;mouse.y
  388.                 cmp eax,3d_wnd_t
  389.                 jg @f
  390.                         mov eax,3d_wnd_t
  391.                 @@:
  392.                 sub eax,3d_wnd_t
  393.                 cmp eax,3d_wnd_h
  394.                 jle @f
  395.                         mov eax,3d_wnd_h
  396.                 @@:
  397.                 finit
  398.                 fild dword[mouse_y]
  399.                 mov [mouse_y],eax
  400.                 fisub dword[mouse_y]
  401.                 fdiv dword[angle_dxm] ;¥á«¨ ªãàá®à ¤¢¨¦¥âáï ¯® ®á¨ y (¢¢¥àå ¨«¨ ¢­¨§) â® ¯®¢®à®â ¤¥« ¥¬ ¢®ªà㣠®á¨ x
  402.                 fadd dword[angle_x]
  403.                 fstp dword[angle_x]
  404.  
  405.                 fild dword[mouse_x]
  406.                 mov [mouse_x],ebx
  407.                 fisub dword[mouse_x]
  408.                 fdiv dword[angle_dym] ;¥á«¨ ªãàá®à ¤¢¨¦¥âáï ¯® ®á¨ x (¢¢¥àå ¨«¨ ¢­¨§) â® ¯®¢®à®â ¤¥« ¥¬ ¢®ªà㣠®á¨ y
  409.                 fadd dword[angle_y]
  410.                 fstp dword[angle_y]
  411.  
  412.                 stdcall draw_3d, o3d
  413.                 jmp .end_d
  414.         .end_m:
  415.         bt eax,16
  416.         jnc @f
  417.                 ;mouse l. but. up
  418.                 mov dword[mouse_drag],0
  419.                 jmp .end_d
  420.         @@:
  421.         bt eax,8
  422.         jnc .end_d
  423.                 ;mouse l. but. press
  424.                 mcall 37,1 ;get mouse coords
  425.                 mov ebx,eax
  426.                 shr ebx,16 ;mouse.x
  427.                 cmp ebx,3d_wnd_l
  428.                 jl .end_d
  429.                 sub ebx,3d_wnd_l
  430.                 cmp ebx,3d_wnd_w
  431.                 jg .end_d
  432.                 and eax,0xffff ;mouse.y
  433.                 cmp eax,3d_wnd_t
  434.                 jl .end_d
  435.                 sub eax,3d_wnd_t
  436.                 cmp eax,3d_wnd_h
  437.                 jg .end_d
  438.                 mov dword[mouse_drag],1
  439.                 mov dword[mouse_x],ebx
  440.                 mov dword[mouse_y],eax
  441.         .end_d:
  442.  
  443.         stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
  444.         stdcall [tl_mouse], tree3
  445.         stdcall [edit_box_mouse], edit1
  446.         stdcall [edit_box_mouse], edit2
  447.         stdcall [edit_box_mouse], edit3
  448.         pop ebx eax
  449.         ret
  450.  
  451. align 4
  452. prop_button:
  453.         mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
  454.  
  455.         cmp ah,3
  456.         jne @f
  457.                 call get_point_coords
  458.                 stdcall draw_3d, o3d
  459.                 jmp prop_still.end
  460.         @@:
  461.         cmp ah,4
  462.         jne @f
  463.                 push eax ebx ecx edi esi
  464.                 stdcall [tl_node_get_data],tree3
  465.                 cmp eax,0
  466.                 je .no_select_1
  467.                         mov ebx,[eax]
  468.                         finit
  469.  
  470.                         mov esi,string1
  471.                         mov edi,Data_String
  472.                         cld
  473.                         mov ecx,8
  474.                         rep movsd
  475.                         call String_to_DoubleFloat
  476.                         fld  qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
  477.                         fstp dword[ebx] ;á®å࠭塞 ª ª float
  478.  
  479.                         mov esi,string2
  480.                         mov edi,Data_String
  481.                         cld
  482.                         mov ecx,8
  483.                         rep movsd
  484.                         call String_to_DoubleFloat
  485.                         fld  qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
  486.                         fstp dword[ebx+4] ;á®å࠭塞 ª ª float
  487.  
  488.                         mov esi,string3
  489.                         mov edi,Data_String
  490.                         cld
  491.                         mov ecx,8
  492.                         rep movsd
  493.                         call String_to_DoubleFloat
  494.                         fld  qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
  495.                         fstp dword[ebx+8] ;á®å࠭塞 ª ª float
  496.  
  497.                         ;®¡­®¢«¥­¨¥ ¨§¬¥­¥­­®£® 㧫  ¢ ᯨ᪥ tree3 ¨ £« ¢­®£® ®ª­  (¯® â ©¬¥àã)
  498.                         mov word[NumberSymbolsAD],5
  499.                         mov dword[obj_point],ebx
  500.                         mov dword[obj_point.text],0
  501.                         cld
  502.                         mov ecx,3
  503.                         .coord:
  504.                                 fld dword[ebx]
  505.                                 fstp qword[Data_Double]
  506.                                 call DoubleFloat_to_String
  507.                                 add ebx,4
  508.                                 stdcall str_len, Data_String
  509.                                 mov esi,txt_space
  510.                                 add esi,eax
  511.                                 cmp esi,txt_space.end
  512.                                 jl .normal_size
  513.                                         mov esi,txt_space.end-1 ;¬¨­¨¬ã¬ 1 ¯à®¡¥« ­ã¦­® ¤®¡ ¢¨âì, çâ®-¡ë æ¨äàë ­¥ ᫨¯ «¨áì
  514.                                 .normal_size:
  515.                                 stdcall str_cat, obj_point.text,esi
  516.                                 stdcall str_cat, obj_point.text,Data_String
  517.                                 loop .coord
  518.                         mov byte[obj_point.text],'*' ;®â¬¥ç ¥¬ çâ® ¢¥à設  ¨§¬¥­ï« áì
  519.                         stdcall dword[tl_node_set_data], tree3,obj_point
  520.                         stdcall dword[tl_draw], tree3
  521.                         mov byte[can_save],1 ;¤«ï ¯®ª §  ª­®¯ª¨ '‘®åà ­¨âì'
  522.                         mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¡«®ª  ¢ â ©¬¥à¥
  523.                         stdcall draw_3d, o3d
  524.                 .no_select_1:
  525.                 pop esi edi ecx ebx eax
  526.                 jmp prop_still.end
  527.         @@:
  528.         cmp ah,5
  529.         jne @f
  530.                 call mnu_vertexes_on_off
  531.                 jmp prop_still.end
  532.         @@:
  533.         cmp ah,6
  534.         jne @f
  535.                 call mnu_faces_on_off
  536.                 jmp prop_still.end
  537.         @@:
  538.         cmp ah,7
  539.         jne @f
  540.                 call mnu_faces_fill_on_off
  541.                 jmp prop_still.end
  542.         @@:
  543.         cmp ah,8
  544.         jne @f
  545.                 call mnu_light_on_off
  546.                 jmp prop_still.end
  547.         @@:
  548.         cmp ah,9
  549.         jne @f
  550.                 call mnu_reset_settings
  551.                 jmp prop_still.end
  552.         @@:
  553.         cmp ah,10
  554.         jne @f
  555.                 call mnu_vertexes_select
  556.                 jmp prop_still.end
  557.         @@:
  558.         cmp ah,11
  559.         jne @f
  560.                 call mnu_vertexes_deselect
  561.                 jmp prop_still.end
  562.         @@:
  563.         cmp ah,12
  564.         jne @f
  565.                 call mnu_reset_average_x
  566.                 jmp prop_still.end
  567.         @@:
  568.         cmp ah,13
  569.         jne @f
  570.                 call mnu_reset_average_y
  571.                 jmp prop_still.end
  572.         @@:
  573.         cmp ah,14
  574.         jne @f
  575.                 call mnu_reset_average_z
  576.                 jmp prop_still.end
  577.         @@:
  578.  
  579.         cmp ah,1
  580.         jne prop_still.end
  581. .exit:
  582.         mov dword[tree3.data_img],0 ;ç¨á⨬ 㪠§ â¥«¨ ­  ¨ª®­ª¨ çâ®-¡ë ¨å ­¥ 㤠«¨« ¤¥áâàãªâ®à
  583.         mov dword[tree3.data_img_sys],0 ;â. ª. ®­¨ ¥é¥ ¨á¯®«ì§ãîâìáï ¢ ¤à㣨å í«¥¬¥­â å
  584.         stdcall dword[tl_data_clear], tree3
  585.         mov edi,o3d
  586.         stdcall mem.Free,[edi+offs_obj_normals_tri_data]
  587.         stdcall mem.Free,[edi+offs_obj_normals_poi_data]
  588.         mov dword[edi+offs_obj_normals_tri_data],0
  589.         mov dword[edi+offs_obj_normals_poi_data],0
  590.         mov byte[prop_wnd_run],0 ;®¡­ã«ï¥¬ áç¥â稪 ®ª®­
  591.         mcall -1 ;¢ë室 ¨§ ¯à®£à ¬¬ë
  592.  
  593. align 4
  594. get_point_coords:
  595.         ;§ £à㧪  ª®®à¤¨­ â ¢ editbox-ë
  596.         push eax ebx
  597.         stdcall [tl_node_get_data],tree3
  598.         cmp eax,0
  599.         je @f
  600.                 mov ebx,[eax]
  601.                 mov word[NumberSymbolsAD],8
  602.                 finit
  603.                 fld dword[ebx]
  604.                 fstp qword[Data_Double]
  605.                 call DoubleFloat_to_String
  606.                 stdcall [edit_box_set_text], edit1, Data_String
  607.                 fld dword[ebx+4]
  608.                 fstp qword[Data_Double]
  609.                 call DoubleFloat_to_String
  610.                 stdcall [edit_box_set_text], edit2, Data_String
  611.                 fld dword[ebx+8]
  612.                 fstp qword[Data_Double]
  613.                 call DoubleFloat_to_String
  614.                 stdcall [edit_box_set_text], edit3, Data_String
  615.                 stdcall [edit_box_draw], edit1
  616.                 stdcall [edit_box_draw], edit2
  617.                 stdcall [edit_box_draw], edit3
  618.         @@:
  619.         pop ebx eax
  620.         ret
  621.  
  622. align 4
  623. proc prop_timer_funct uses eax
  624.         ;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥­­ãî ª®®à¤¨­ âã
  625.         stdcall [tl_node_get_data],tree3
  626.         cmp [cursor_last_draw],eax
  627.         je @f
  628.                 mov [cursor_last_draw],eax
  629.                 stdcall draw_3d, o3d
  630.         @@:
  631.         ret
  632. endp
  633.  
  634. align 4
  635. proc mnu_vertexes_select uses eax ebx
  636.         stdcall [tl_node_get_data],tree3
  637.         cmp eax,0
  638.         je .no_points
  639.         stdcall found_block_data,tree3
  640.         cmp eax,0
  641.         je .no_points
  642.                 mov bx,word[eax]
  643.                 cmp bx,ID_ICON_POINT_SEL
  644.                 je @f
  645.                         mov word[eax],ID_ICON_POINT_SEL
  646.                         inc dword[obj_poi_sel_c]
  647.                         jmp .change
  648.                 @@:
  649.                         mov word[eax],ID_ICON_POINT
  650.                         dec dword[obj_poi_sel_c]
  651.                 .change:
  652.                         mov eax,[obj_poi_sel_c]
  653.                         stdcall convert_int_to_str, txt_select_vert.count,16
  654.         .no_points:
  655.         ret
  656. endp
  657.  
  658. align 4
  659. proc mnu_vertexes_deselect uses eax
  660.         cmp dword[obj_poi_sel_c],0
  661.         je .no_points
  662.         mov dword[obj_poi_sel_c],0
  663.         stdcall [tl_node_poi_get_info], tree3,0
  664.         cmp eax,0
  665.         je .no_points
  666.         @@:
  667.                 mov word[eax],ID_ICON_POINT
  668.                 stdcall [tl_node_poi_get_next_info], tree3,eax
  669.                 cmp eax,0
  670.                 jne @b
  671.         .no_points:
  672.         ret
  673. endp
  674.  
  675. align 4
  676. proc mnu_reset_average_x uses eax ebx ecx edx edi
  677.         cmp dword[obj_poi_sel_c],2
  678.         jl .end_select
  679.                 finit
  680.                 fldz
  681.                 mov ecx,dword[obj_poi_sel_c]
  682.                 stdcall dword[tl_node_poi_get_info], tree3,0
  683.                 @@:
  684.                         cmp eax,0
  685.                         je .end_select
  686.                         mov ebx,eax
  687.                         cmp word[ebx],ID_ICON_POINT_SEL
  688.                         jne .next_sel0
  689.                                 stdcall [tl_node_poi_get_data], tree3,ebx
  690.                                 mov eax,[eax]
  691.                                 fadd dword[eax]
  692.                                 dec ecx
  693.                                 jz @f
  694.                         .next_sel0:
  695.                         stdcall dword[tl_node_poi_get_next_info], tree3,ebx
  696.                         jmp @b
  697.                 @@:
  698.                 fidiv dword[obj_poi_sel_c]
  699.                 fstp dword[eax]
  700.                 mov edx,[eax]
  701.                 mov ecx,dword[obj_poi_sel_c]
  702.                 stdcall dword[tl_node_poi_get_info], tree3,0
  703.                 @@:
  704.                         cmp eax,0
  705.                         je .end_select
  706.                         mov ebx,eax
  707.                         cmp word[ebx],ID_ICON_POINT_SEL
  708.                         jne .next_sel1
  709.                                 stdcall [tl_node_poi_get_data], tree3,ebx
  710.                                 mov edi,eax
  711.                                 mov eax,[eax]
  712.                                 mov [eax],edx
  713.                                 stdcall update_tree, edi
  714.                                 dec ecx
  715.                                 jz @f
  716.                         .next_sel1:
  717.                         stdcall dword[tl_node_poi_get_next_info], tree3,ebx
  718.                         jmp @b
  719.                 @@:
  720.     .end_select:
  721.         ret
  722. endp
  723.  
  724. align 4
  725. proc mnu_reset_average_y uses eax ebx ecx edx edi
  726.         cmp dword[obj_poi_sel_c],2
  727.         jl .end_select
  728.                 finit
  729.                 fldz
  730.                 mov ecx,dword[obj_poi_sel_c]
  731.                 stdcall dword[tl_node_poi_get_info], tree3,0
  732.                 @@:
  733.                         cmp eax,0
  734.                         je .end_select
  735.                         mov ebx,eax
  736.                         cmp word[ebx],ID_ICON_POINT_SEL
  737.                         jne .next_sel0
  738.                                 stdcall [tl_node_poi_get_data], tree3,ebx
  739.                                 mov eax,[eax]
  740.                                 fadd dword[eax+4]
  741.                                 dec ecx
  742.                                 jz @f
  743.                         .next_sel0:
  744.                         stdcall dword[tl_node_poi_get_next_info], tree3,ebx
  745.                         jmp @b
  746.                 @@:
  747.                 fidiv dword[obj_poi_sel_c]
  748.                 fstp dword[eax+4]
  749.                 mov edx,[eax+4]
  750.                 mov ecx,dword[obj_poi_sel_c]
  751.                 stdcall dword[tl_node_poi_get_info], tree3,0
  752.                 @@:
  753.                         cmp eax,0
  754.                         je .end_select
  755.                         mov ebx,eax
  756.                         cmp word[ebx],ID_ICON_POINT_SEL
  757.                         jne .next_sel1
  758.                                 stdcall [tl_node_poi_get_data], tree3,ebx
  759.                                 mov edi,eax
  760.                                 mov eax,[eax]
  761.                                 mov [eax+4],edx
  762.                                 stdcall update_tree, edi
  763.                                 dec ecx
  764.                                 jz @f
  765.                         .next_sel1:
  766.                         stdcall dword[tl_node_poi_get_next_info], tree3,ebx
  767.                         jmp @b
  768.                 @@:
  769.     .end_select:
  770.         ret
  771. endp
  772.  
  773. align 4
  774. proc mnu_reset_average_z uses eax ebx ecx edx edi
  775.         cmp dword[obj_poi_sel_c],2
  776.         jl .end_select
  777.                 finit
  778.                 fldz
  779.                 mov ecx,dword[obj_poi_sel_c]
  780.                 stdcall dword[tl_node_poi_get_info], tree3,0
  781.                 @@:
  782.                         cmp eax,0
  783.                         je .end_select
  784.                         mov ebx,eax
  785.                         cmp word[ebx],ID_ICON_POINT_SEL
  786.                         jne .next_sel0
  787.                                 stdcall [tl_node_poi_get_data], tree3,ebx
  788.                                 mov eax,[eax]
  789.                                 fadd dword[eax+8]
  790.                                 dec ecx
  791.                                 jz @f
  792.                         .next_sel0:
  793.                         stdcall dword[tl_node_poi_get_next_info], tree3,ebx
  794.                         jmp @b
  795.                 @@:
  796.                 fidiv dword[obj_poi_sel_c]
  797.                 fstp dword[eax+8]
  798.                 mov edx,[eax+8]
  799.                 mov ecx,dword[obj_poi_sel_c]
  800.                 stdcall dword[tl_node_poi_get_info], tree3,0
  801.                 @@:
  802.                         cmp eax,0
  803.                         je .end_select
  804.                         mov ebx,eax
  805.                         cmp word[ebx],ID_ICON_POINT_SEL
  806.                         jne .next_sel1
  807.                                 stdcall [tl_node_poi_get_data], tree3,ebx
  808.                                 mov edi,eax
  809.                                 mov eax,[eax]
  810.                                 mov [eax+8],edx
  811.                                 stdcall update_tree, edi
  812.                                 dec ecx
  813.                                 jz @f
  814.                         .next_sel1:
  815.                         stdcall dword[tl_node_poi_get_next_info], tree3,ebx
  816.                         jmp @b
  817.                 @@:
  818.     .end_select:
  819.         ret
  820. endp
  821.  
  822. align 4
  823. proc update_tree h_mem:dword
  824. pushad
  825.         mov edi,[h_mem]
  826.         mov ebx,[edi]
  827.         finit
  828.  
  829.         ;®¡­®¢«¥­¨¥ ¨§¬¥­¥­­®£® 㧫  ¢ ᯨ᪥ tree3 ¨ £« ¢­®£® ®ª­  (¯® â ©¬¥àã)
  830.         mov word[NumberSymbolsAD],5
  831.         mov dword[obj_point.text],0
  832.         cld
  833.         mov ecx,3
  834.         .coord:
  835.                 fld dword[ebx]
  836.                 fstp qword[Data_Double]
  837.                 call DoubleFloat_to_String
  838.                 add ebx,4
  839.                 stdcall str_len, Data_String
  840.                 mov esi,txt_space
  841.                 add esi,eax
  842.                 cmp esi,txt_space.end
  843.                 jl .normal_size
  844.                         mov esi,txt_space.end-1 ;¬¨­¨¬ã¬ 1 ¯à®¡¥« ­ã¦­® ¤®¡ ¢¨âì, çâ®-¡ë æ¨äàë ­¥ ᫨¯ «¨áì
  845.                 .normal_size:
  846.                 stdcall str_cat, obj_point.text,esi
  847.                 stdcall str_cat, obj_point.text,Data_String
  848.                 loop .coord
  849.         mov esi,obj_point.text
  850.         mov byte[esi],'*' ;®â¬¥ç ¥¬ çâ® ¢¥à設  ¨§¬¥­ï« áì
  851.         mov byte[can_save],1 ;¤«ï ¯®ª §  ª­®¯ª¨ '‘®åà ­¨âì'
  852.         add edi,4
  853.         mov ecx,MAX_OBJECT_SIZE-4
  854.         rep movsb
  855. popad
  856.         ret
  857. endp
  858.  
  859. align 4
  860. angle_dxm dd 1.7775 ;~ 3d_wnd_w/180 - ¯à¨¡ ¢«¥­¨¥ 㣫®¢ ¯®¢®à®â  áæ¥­ë ¯à¨ ¢à é¥­¨¨ ¬ë襩
  861. angle_dym dd 1.3335 ;~ 3d_wnd_h/180
  862. ratio dd 1.3333 ;~ 3d_wnd_w/3d_wnd_h
  863. cursor_last_draw dd 0 ;¯®«®¦¥­¨¥ ªãàá®à  ¯à¨ ¯®á«¥¤­¥© ¯à®à¨á®¢ª¥ 3d ®ª­ 
  864. capt_p dd 0
  865.  
  866. ;¤¥à¥¢® á ®¡ê¥ªâ ¬¨ ¢ ¯®«ì§®¢ â¥«ì᪮¬ ä ©«¥
  867. tree3 tree_list MAX_OBJECT_SIZE,3, tl_key_no_edit+tl_list_box_mode,\
  868.         16,16, 0xffffff,0xb0d0ff,0x400040, 5,290,303,140, 16, 4,0, el_focus,\
  869.         w_scr_t3,get_point_coords
  870.  
  871. edit1 edit_box 80,  76, 269, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 34, string1, mouse_dd, 0
  872. edit2 edit_box 80, 160, 269, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 34, string2, mouse_dd, 0
  873. edit3 edit_box 80, 244, 269, 0xd0ffd0, 0xff, 0x80ff, 0, 0x8000, 34, string3, mouse_dd, 0
  874. editboxes_end:
  875.  
  876. string1 rb 34
  877. string2 rb 34
  878. string3 rb 34
  879.  
  880. align 4
  881. w_scr_t3 scrollbar 16, 0,0,0, 15, 100,0,0, 0,0,0, 1
  882.