Rev 5278 | Rev 5922 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5278 | Rev 5387 | ||
---|---|---|---|
Line 606... | Line 606... | ||
606 | fscale ;st1=z, st0=(2**trunc(z))*(2**(z-trunc(z)))=2**t |
606 | fscale ;st1=z, st0=(2**trunc(z))*(2**(z-trunc(z)))=2**t |
607 | fxch st1 |
607 | fxch st1 |
608 | fstp st ;Результат остается на вершине стека st0 |
608 | fstp st ;Результат остается на вершине стека st0 |
609 | fmul dword[att] |
609 | fmul dword[att] |
610 | fstp dword[att] ;att=att*pow(dot_spot,l.spot_exponent) |
610 | fstp dword[att] ;att=att*pow(dot_spot,l.spot_exponent) |
611 | jmp .if1_end |
611 | jmp .if1_end_f1 |
612 | @@: |
612 | @@: |
613 | ffree st0 ;l.spot_exponent |
613 | ffree st0 ;l.spot_exponent |
614 | fincstp |
614 | fincstp |
- | 615 | .if1_end_f1: |
|
615 | ffree st0 ;dot_spot |
616 | ffree st0 ;dot_spot |
616 | fincstp |
617 | fincstp |
617 | .if1_end: |
618 | .if1_end: |
Line 618... | Line 619... | ||
618 | 619 | ||
Line 646... | Line 647... | ||
646 | fld1 |
647 | fld1 |
647 | fadd dword[d+offs_Z] |
648 | fadd dword[d+offs_Z] |
648 | fstp dword[s+offs_Z] ;s.Z=d.Z+1.0 |
649 | fstp dword[s+offs_Z] ;s.Z=d.Z+1.0 |
649 | .els_2_end: |
650 | .els_2_end: |
650 | fld dword[n] |
651 | fld dword[n] |
651 | fmul st0,st0 |
652 | fmul dword[s] |
652 | fld dword[n+offs_Y] |
653 | fld dword[n+offs_Y] |
653 | fmul st0,st0 |
654 | fmul dword[s+offs_Y] |
654 | faddp |
655 | faddp |
655 | fld dword[n+offs_Z] |
656 | fld dword[n+offs_Z] |
656 | fmul st0,st0 |
657 | fmul dword[s+offs_Z] |
657 | faddp ;dot_spec = n.X^2 +n.Y^2 +n.Z^2 |
658 | faddp ;dot_spec = n.X*s.X +n.Y*s.Y +n.Z*s.Z |
658 | cmp dword[twoside],0 ;if (twoside && dot_spec < 0) |
659 | cmp dword[twoside],0 ;if (twoside && dot_spec < 0) |
659 | je @f |
660 | je @f |
660 | ftst ;if (dot_spec < 0) |
661 | ftst ;if (dot_spec < 0) |
661 | fstsw ax |
662 | fstsw ax |
662 | sahf |
663 | sahf |
Line 708... | Line 709... | ||
708 | fld dword[ebx+offs_ligh_specular] |
709 | fld dword[ebx+offs_ligh_specular] |
709 | fmul st0,st1 |
710 | fmul st0,st1 |
710 | fmul dword[ecx+offs_mate_specular] |
711 | fmul dword[ecx+offs_mate_specular] |
711 | fadd dword[lR] |
712 | fadd dword[lR] |
712 | fstp dword[lR] ;lR+=dot_spec * l.specular.v[0] * m.specular.v[0] |
713 | fstp dword[lR] ;lR+=dot_spec * l.specular.v[0] * m.specular.v[0] |
713 | ;ffree st0 |
- | |
714 | ;fincstp |
- | |
715 | fld dword[ebx+offs_ligh_specular+4] |
714 | fld dword[ebx+offs_ligh_specular+4] |
716 | fmul st0,st1 |
715 | fmul st0,st1 |
717 | fmul dword[ecx+offs_mate_specular+4] |
716 | fmul dword[ecx+offs_mate_specular+4] |
718 | fadd dword[lG] |
717 | fadd dword[lG] |
719 | fstp dword[lG] ;lG+=dot_spec * l.specular.v[1] * m.specular.v[1] |
718 | fstp dword[lG] ;lG+=dot_spec * l.specular.v[1] * m.specular.v[1] |
720 | ;ffree st0 |
- | |
721 | ;fincstp |
- | |
722 | fld dword[ebx+offs_ligh_specular+8] |
719 | fld dword[ebx+offs_ligh_specular+8] |
723 | fmul st0,st1 |
720 | fmul st0,st1 |
724 | fmul dword[ecx+offs_mate_specular+8] |
721 | fmul dword[ecx+offs_mate_specular+8] |
725 | fadd dword[lB] |
722 | fadd dword[lB] |
726 | fstp dword[lB] ;lB+=dot_spec * l.specular.v[2] * m.specular.v[2] |
723 | fstp dword[lB] ;lB+=dot_spec * l.specular.v[2] * m.specular.v[2] |
727 | ;ffree st0 |
- | |
728 | ;fincstp |
- | |
729 | ffree st0 ;dot_spec |
- | |
730 | fincstp |
- | |
731 | jmp .if2_end |
- | |
732 | .if0_end: |
724 | .if0_end: |
733 | ffree st0 ;dot [or] dot_spec |
725 | ffree st0 ;dot [or] dot_spec |
734 | fincstp |
726 | fincstp |
735 | .if2_end: |
727 | .if2_end: |