Rev 7441 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7441 | Rev 7663 | ||
---|---|---|---|
Line 116... | Line 116... | ||
116 | PROP_BIT_SELECT equ 30 ;â®çª ¯®¤ ¢ë¤¥«¥¨¥¬ |
116 | PROP_BIT_SELECT equ 30 ;â®çª ¯®¤ ¢ë¤¥«¥¨¥¬ |
117 | 117 | ||
Line 118... | Line 118... | ||
118 | align 4 |
118 | align 4 |
119 | zoom_plus dq 1.25992105 |
119 | zoom_plus dq 1.25992105 |
- | 120 | opt_koef dq 0.02 ;ª®¥ä. ¤«ï ®¯â¨¬¨§ 樨 (祬 ¡«¨¦¥ ª 0, ⥬ ¯àﬥ¥ «¨¨ï) |
|
120 | mouse_prop_x dd 0 ;ªãàá®à ¬ëè¨ ®â®á¨â¥«ì® æ¥âà ®ª buf_0 (¤«ï ¨§¬¥. ¬ áèâ ¡ ) |
121 | mouse_prop_x dd 0 ;ªãàá®à ¬ëè¨ ®â®á¨â¥«ì® æ¥âà ®ª buf_0 (¤«ï ¨§¬¥. ¬ áèâ ¡ ) |
121 | mouse_prop_y dd 0 |
122 | mouse_prop_y dd 0 |
122 | mouse_down_x dd 0 ;ªãàá®à ¬ëè¨ ®â®á¨â¥«ì® «¥¢®£® ¢¥à奣® 㣫 ®ª buf_0 (¤«ï ᤢ¨£ 䨣ãàë) |
123 | mouse_down_x dd 0 ;ªãàá®à ¬ëè¨ ®â®á¨â¥«ì® «¥¢®£® ¢¥à奣® 㣫 ®ª buf_0 (¤«ï ᤢ¨£ 䨣ãàë) |
123 | mouse_down_y dd 0 |
124 | mouse_down_y dd 0 |
124 | opt_draw dd 1 |
125 | opt_draw dd 1 |
Line 1523... | Line 1524... | ||
1523 | .no_point: |
1524 | .no_point: |
1524 | ret |
1525 | ret |
1525 | endp |
1526 | endp |
1526 | 1527 | ||
Line -... | Line 1528... | ||
- | 1528 | ;description: |
|
- | 1529 | ; ®¯â¨¬¨§ æ¨ï 䨣ãàë, ¢ë¤¥«ï¥â «¨è¨¥ â®çª¨ (1-ï ¨ ¯®á«¥¤ïï â®çª¨ ¥ ãç¨âë¢ îâáï) |
|
- | 1530 | align 4 |
|
- | 1531 | proc points_optimize uses eax ebx ecx, pFig:dword |
|
- | 1532 | mov ebx,[pFig] |
|
- | 1533 | mov ecx,[ebx+Figure.PoiCount] |
|
- | 1534 | cmp ecx,3 |
|
- | 1535 | jl .no_point |
|
- | 1536 | sub ecx,2 ;®â¨¬ ¥¬ â®çª¨ ª®â®àë¥ ¥ ãç¨âë¢ îâáï |
|
- | 1537 | stdcall sel_points_clear,ebx |
|
- | 1538 | mov ebx,[ebx+Figure.PoiData] |
|
- | 1539 | finit |
|
- | 1540 | .cycle0: |
|
- | 1541 | ;calc (x0-x1)/(x0-x2) |
|
- | 1542 | fld qword[ebx+Point.CoordX] |
|
- | 1543 | add ebx,sizeof.Point |
|
- | 1544 | fcom qword[ebx+Point.CoordX] |
|
- | 1545 | fstsw ax |
|
- | 1546 | sahf |
|
- | 1547 | jne @f |
|
- | 1548 | fcomp qword[ebx+sizeof.Point+Point.CoordX] |
|
- | 1549 | fstsw ax |
|
- | 1550 | sahf |
|
- | 1551 | jne .no_sel ;if( (x0==x1) && (x0!=x2) ) |
|
- | 1552 | jmp .sel ;if( x0==x1==x2 ) |
|
- | 1553 | @@: |
|
- | 1554 | fld st0 |
|
- | 1555 | fsub qword[ebx+Point.CoordX] |
|
- | 1556 | fxch st1 |
|
- | 1557 | fsub qword[ebx+sizeof.Point+Point.CoordX] |
|
- | 1558 | fdivp |
|
- | 1559 | ||
- | 1560 | ;calc (y0-y1)/(y0-y2) |
|
- | 1561 | fld qword[ebx-sizeof.Point+Point.CoordY] |
|
- | 1562 | fcom qword[ebx+Point.CoordY] |
|
- | 1563 | fstsw ax |
|
- | 1564 | sahf |
|
- | 1565 | jne @f |
|
- | 1566 | fcomp qword[ebx+sizeof.Point+Point.CoordY] |
|
- | 1567 | fstsw ax |
|
- | 1568 | ffree st0 ;free (x0-x1)/(x0-x2) |
|
- | 1569 | fincstp |
|
- | 1570 | sahf |
|
- | 1571 | jne .no_sel ;if( (y0==y1) && (y0!=y2) ) |
|
- | 1572 | jmp .sel ;if( y0==y1==y2 ) |
|
- | 1573 | @@: |
|
- | 1574 | fld st0 |
|
- | 1575 | fsub qword[ebx+Point.CoordY] |
|
- | 1576 | fxch st1 |
|
- | 1577 | fsub qword[ebx+sizeof.Point+Point.CoordY] |
|
- | 1578 | fdivp |
|
- | 1579 | ||
- | 1580 | fsubp |
|
- | 1581 | fabs |
|
- | 1582 | fcomp qword[opt_koef] ;if( abs((x0-x1)/(x0-x2)-(y0-y1)/(y0-y2)) > 0.02) |
|
- | 1583 | fstsw ax |
|
- | 1584 | sahf |
|
- | 1585 | jae .no_sel |
|
- | 1586 | .sel: |
|
- | 1587 | bts dword[ebx+Point.Prop],PROP_BIT_SELECT |
|
- | 1588 | .no_sel: |
|
- | 1589 | loop .cycle0 |
|
- | 1590 | .no_point: |
|
- | 1591 | ret |
|
- | 1592 | endp |
|
- | 1593 | ||
1527 | ;input: |
1594 | ;input: |
1528 | ; pPoi - 㪠§ â¥«ì ¤ ë¥ â®çª¨ |
1595 | ; pPoi - 㪠§ â¥«ì ¤ ë¥ â®çª¨ |
1529 | align 4 |
1596 | align 4 |
1530 | proc point_move_up, pObj:dword,pFig:dword,idFig:dword,pPoi:dword |
1597 | proc point_move_up, pObj:dword,pFig:dword,idFig:dword,pPoi:dword |
1531 | pushad |
1598 | pushad |
Line 1563... | Line 1630... | ||
1563 | 1630 | ||
Line 1564... | Line 1631... | ||
1564 | cmp [eax+Figure.OType],'Fig' |
1631 | cmp [eax+Figure.OType],'Fig' |
1565 | je @f |
1632 | je @f |
1566 | cmp [eax+Figure.OType],'Obj' |
1633 | cmp [eax+Figure.OType],'Obj' |
1567 | je .end0 |
- | |
1568 | jmp .end_f |
1634 | jne .end_f |
1569 | .end0: |
- | |
1570 | mov eax,ObjData |
1635 | mov eax,ObjData |
1571 | @@: |
1636 | @@: |
1572 | call buf_get_mouse_coord |
1637 | call buf_get_mouse_coord |
1573 | cmp eax,-1 |
1638 | cmp eax,-1 |
1574 | je .end_f |
1639 | je .end_f |
Line 1586... | Line 1651... | ||
1586 | 1651 | ||
Line 1587... | Line 1652... | ||
1587 | cmp [eax+Figure.OType],'Fig' |
1652 | cmp [eax+Figure.OType],'Fig' |
1588 | je @f |
1653 | je @f |
1589 | cmp [eax+Figure.OType],'Obj' |
1654 | cmp [eax+Figure.OType],'Obj' |
1590 | je .end0 |
- | |
1591 | jmp .end_f |
1655 | jne .end_f |
1592 | .end0: |
- | |
1593 | mov eax,ObjData |
1656 | mov eax,ObjData |
1594 | @@: |
1657 | @@: |
1595 | mov ecx,eax |
1658 | mov ecx,eax |
Line 1596... | Line 1659... | ||
1596 | 1659 |