diff --git a/Core/Libraries/Source/WWVegas/WWMath/matrix4.cpp b/Core/Libraries/Source/WWVegas/WWMath/matrix4.cpp index 0b489a40c72..b346825c584 100644 --- a/Core/Libraries/Source/WWVegas/WWMath/matrix4.cpp +++ b/Core/Libraries/Source/WWVegas/WWMath/matrix4.cpp @@ -46,6 +46,7 @@ #include "WWLib/win.h" #include #include +#include /*********************************************************************************************** * Matrix4x4::Multiply -- Multiply two Matrix4x4's together * @@ -180,18 +181,10 @@ void Matrix4x4::Multiply(const Matrix4x4 & a,const Matrix3D & b,Matrix4x4 * res) #undef ROWCOL4 } +// Compares the bits of the elements, so 0.0f and -0.0f differ and identical NaNs are equal. int operator == (const Matrix4x4 & a, const Matrix4x4 & b) { - unsigned* m1=(unsigned*)&a; - unsigned* m2=(unsigned*)&b; - unsigned res=0; - for (int i=0;i<4;++i) { - res|=*m1++^*m2++; - res|=*m1++^*m2++; - res|=*m1++^*m2++; - res|=*m1++^*m2++; - } - return !res; + return memcmp(&a, &b, sizeof(Matrix4x4)) == 0; } int operator != (const Matrix4x4 & a, const Matrix4x4 & b)