diff --git a/desmume/src/gfx3d.cpp b/desmume/src/gfx3d.cpp index 48384cfac..405059d39 100644 --- a/desmume/src/gfx3d.cpp +++ b/desmume/src/gfx3d.cpp @@ -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); }