Rev 5353 | Rev 6017 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5353 | Rev 5418 | ||
---|---|---|---|
Line 706... | Line 706... | ||
706 | ;or edi,___ - было выше |
706 | ;or edi,___ - было выше |
707 | jnz .els_0 |
707 | jnz .els_0 |
708 | ;if (co==0) |
708 | ;if (co==0) |
709 | mov edi,dword[edx+offs_vert_zp+offs_zbup_x] |
709 | mov edi,dword[edx+offs_vert_zp+offs_zbup_x] |
710 | sub edi,dword[ebx+offs_vert_zp+offs_zbup_x] |
710 | sub edi,dword[ebx+offs_vert_zp+offs_zbup_x] |
711 | mov dword[norm],edi |
711 | mov dword[norm],edi ;p2.x-p0.x |
712 | fild dword[norm] |
712 | fild dword[norm] |
713 | mov edi,dword[ecx+offs_vert_zp+offs_zbup_y] |
713 | mov edi,dword[ecx+offs_vert_zp+offs_zbup_y] |
714 | sub edi,dword[ebx+offs_vert_zp+offs_zbup_y] |
714 | sub edi,dword[ebx+offs_vert_zp+offs_zbup_y] |
715 | mov dword[norm],edi |
715 | mov dword[norm],edi ;p1.y-p0.y |
716 | fimul dword[norm] |
716 | fimul dword[norm] |
- | 717 | fchs |
|
717 | mov edi,dword[ecx+offs_vert_zp+offs_zbup_x] |
718 | mov edi,dword[ecx+offs_vert_zp+offs_zbup_x] |
718 | sub edi,dword[ebx+offs_vert_zp+offs_zbup_x] |
719 | sub edi,dword[ebx+offs_vert_zp+offs_zbup_x] |
719 | mov dword[norm],edi |
720 | mov dword[norm],edi ;p1.x-p0.x |
720 | fild dword[norm] |
721 | fild dword[norm] |
721 | mov edi,dword[edx+offs_vert_zp+offs_zbup_y] |
722 | mov edi,dword[edx+offs_vert_zp+offs_zbup_y] |
722 | sub edi,dword[ebx+offs_vert_zp+offs_zbup_y] |
723 | sub edi,dword[ebx+offs_vert_zp+offs_zbup_y] |
723 | mov dword[norm],edi |
724 | mov dword[norm],edi ;p2.y-p0.y |
724 | fimul dword[norm] |
725 | fimul dword[norm] |
725 | fsubp |
726 | faddp |
726 | - | ||
727 | ;st0 = (p1.zp.x-p0.zp.x)*(p2.zp.y-p0.zp.y) - (p2.zp.x-p0.zp.x)*(p1.zp.y-p0.zp.y) |
727 | ;st0 = (p1.zp.x-p0.zp.x)*(p2.zp.y-p0.zp.y) - (p2.zp.x-p0.zp.x)*(p1.zp.y-p0.zp.y) |
Line 728... | Line 728... | ||
728 | 728 | ||
729 | mov dword[front],0 |
729 | mov dword[front],0 |
730 | fldz |
- | |
731 | fcompp |
730 | ftst |
- | 731 | fstsw ax |
|
- | 732 | ffree st0 |
|
732 | fstsw ax |
733 | fincstp |
733 | sahf |
734 | sahf |
734 | je .end_f |
735 | je .end_f |
735 | jbe @f ;jb @f ??? |
736 | jae @f |
736 | inc dword[front] ;front = 0.0 > norm |
737 | inc dword[front] ;front = norm < 0.0 |
737 | @@: |
738 | @@: |
738 | mov edi,[context] |
739 | mov edi,[context] |
739 | mov eax,dword[edi+offs_cont_current_front_face] |
740 | mov eax,dword[edi+offs_cont_current_front_face] |
- | 741 | xor dword[front],eax ;front ^= context.current_front_face |
|
740 | xor dword[front],eax ;front ^= context.current_front_face |
742 | |
741 | ; back face culling |
743 | ; back face culling |
742 | cmp dword[edi+offs_cont_cull_face_enabled],0 |
744 | cmp dword[edi+offs_cont_cull_face_enabled],0 |
743 | je .els_1 |
745 | je .els_1 |
744 | ; most used case first |
746 | ; most used case first |