Subversion Repositories Kolibri OS

Rev

Rev 6093 | Rev 6523 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6093 Rev 6101
Line 683... Line 683...
683
				; testing specular buffer code
683
				; testing specular buffer code
684
				; dot_spec= pow(dot_spec,m.shininess)
684
				; dot_spec= pow(dot_spec,m.shininess)
685
				stdcall specbuf_get_buffer, edx, dword[ecx+offs_mate_shininess_i], dword[ecx+offs_mate_shininess]
685
				stdcall specbuf_get_buffer, edx, dword[ecx+offs_mate_shininess_i], dword[ecx+offs_mate_shininess]
686
				mov edi,eax ;edi = specbuf
686
				mov edi,eax ;edi = specbuf
687
				mov dword[idx],SPECULAR_BUFFER_SIZE ;idx = SPECULAR_BUFFER_SIZE
687
				mov dword[idx],SPECULAR_BUFFER_SIZE ;idx = SPECULAR_BUFFER_SIZE
688
				fld1
688
 
689
				fcomp
-
 
690
				fstsw ax
689
				;idx = (int)(dot_spec*SPECULAR_BUFFER_SIZE)
691
				fild dword[idx]
690
				fimul dword[idx]
692
				sahf
-
 
693
				jbe @f ;if(dot_spec < 1.0) st0=1 st1=dot_spec
-
 
694
					fmul st0,st1 ;idx *= dot_spec
-
 
695
				@@:
-
 
696
				fistp dword[idx]
691
				fistp dword[idx]				
-
 
692
				;if (idx > SPECULAR_BUFFER_SIZE) idx = SPECULAR_BUFFER_SIZE
-
 
693
				cmp dword[idx],SPECULAR_BUFFER_SIZE
697
				ffree st0 ;dot_spec
694
				jle @f
-
 
695
					mov dword[idx],SPECULAR_BUFFER_SIZE
698
				fincstp
696
				@@:
699
				shl dword[idx],2
697
				shl dword[idx],2
700
				add edi,dword[idx]
698
				add edi,dword[idx]
701
				fld dword[edi+offs_spec_buf] ;dot_spec = specbuf.buf[idx]
699
				fld dword[edi+offs_spec_buf] ;dot_spec = specbuf.buf[idx]
702
				fld dword[ebx+offs_ligh_specular]
700
				fld dword[ebx+offs_ligh_specular]
703
				fmul st0,st1
701
				fmul st0,st1