fix vertex source texcoord generation (fixes environment mapping e.g. stars in sm64); this is a low risk fix and could be safely ported into release branch

This commit is contained in:
zeromus 2009-01-31 04:01:10 +00:00
parent 2578a0a291
commit bf054c32ed
1 changed files with 5 additions and 4 deletions

View File

@ -916,10 +916,11 @@ void gfx3d_glNormal(unsigned long v)
if (texCoordinateTransform == 2)
{
last_s =( (normal[0] *mtxCurrent[3][0] + normal[1] *mtxCurrent[3][4] +
normal[2] *mtxCurrent[3][8]) + _s);
last_t =( (normal[0] *mtxCurrent[3][1] + normal[1] *mtxCurrent[3][5] +
normal[2] *mtxCurrent[3][9]) + _t);
float normal_fixed[3] = {normal[0]/8,normal[1]/8,normal[2]/8};
last_s =( (normal_fixed[0] *mtxCurrent[3][0] + normal_fixed[1] *mtxCurrent[3][4] +
normal_fixed[2] *mtxCurrent[3][8]) + _s);
last_t =( (normal_fixed[0] *mtxCurrent[3][1] + normal_fixed[1] *mtxCurrent[3][5] +
normal_fixed[2] *mtxCurrent[3][9]) + _t);
}