diff --git a/GPU/Math3D.h b/GPU/Math3D.h index 217076bfa8..49311a7433 100644 --- a/GPU/Math3D.h +++ b/GPU/Math3D.h @@ -156,12 +156,6 @@ public: Vec2 ts() const { return Vec2(y, x); } }; -template -Vec2 operator * (const V& f, const Vec2& vec) -{ - return Vec2(f*vec.x,f*vec.y); -} - typedef Vec2 Vec2f; template @@ -323,12 +317,6 @@ public: #undef _DEFINE_SWIZZLER2 }; -template -Vec3 operator * (const V& f, const Vec3& vec) -{ - return Vec3(f*vec.x,f*vec.y,f*vec.z); -} - typedef Vec3 Vec3f; template @@ -497,12 +485,6 @@ public: #undef _DEFINE_SWIZZLER3 }; -template -Vec4 operator * (const V& f, const Vec4& vec) -{ - return Vec4(f*vec.x,f*vec.y,f*vec.z,f*vec.w); -} - typedef Vec4 Vec4f; diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index 314e983234..e51d7d2e16 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -572,7 +572,7 @@ static inline Vec4 GetTextureFunctionOutput(const Vec3& prim_color_rgb { int t = (rgba) ? texcolor.a() : 255; int invt = (rgba) ? 255 - t : 0; - out_rgb = (invt * prim_color_rgb + t * texcolor.rgb()) / 255; + out_rgb = (prim_color_rgb * invt + texcolor.rgb() * t) / 255; out_a = prim_color_a; break; } diff --git a/GPU/Software/TransformUnit.cpp b/GPU/Software/TransformUnit.cpp index b84071fad8..06b0dcd80d 100644 --- a/GPU/Software/TransformUnit.cpp +++ b/GPU/Software/TransformUnit.cpp @@ -128,9 +128,9 @@ static VertexData ReadVertex(VertexReader& vreader) for (int i = 0; i < vertTypeGetNumBoneWeights(gstate.vertType); ++i) { Mat3x3 bone(&gstate.boneMatrix[12*i]); - tmppos += W[i] * (bone * ModelCoords(pos[0], pos[1], pos[2]) + Vec3(gstate.boneMatrix[12*i+9], gstate.boneMatrix[12*i+10], gstate.boneMatrix[12*i+11])); + tmppos += (bone * ModelCoords(pos[0], pos[1], pos[2]) * W[i] + Vec3(gstate.boneMatrix[12*i+9], gstate.boneMatrix[12*i+10], gstate.boneMatrix[12*i+11])); if (vreader.hasNormal()) - tmpnrm += W[i] * (bone * vertex.normal); + tmpnrm += (bone * vertex.normal) * W[i]; } pos[0] = tmppos.x;