From b3ab720d03799507fa73cffbf6db1fc5c5cea76a Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 11 Mar 2010 23:25:15 +0000 Subject: [PATCH] Warning fix by maxim, and add multiplication order in docs git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3245 dfc29bdd-3216-0410-991c-e03cc46cb475 --- include/matrix4.h | 30 ++++++++++++++++-------------- tests/tests-last-passed-at.txt | 4 ++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/include/matrix4.h b/include/matrix4.h index fb531bd5..9342a481 100644 --- a/include/matrix4.h +++ b/include/matrix4.h @@ -22,16 +22,15 @@ //#define USE_MATRIX_TEST_DEBUG #if defined( USE_MATRIX_TEST_DEBUG ) - #include - struct MatrixTest - { - MatrixTest () : ID(0), Calls(0) {} - char buf[256]; - int Calls; - int ID; - }; - static MatrixTest MTest; +struct MatrixTest +{ + MatrixTest () : ID(0), Calls(0) {} + char buf[256]; + int Calls; + int ID; +}; +static MatrixTest MTest; #endif @@ -64,7 +63,7 @@ namespace core //! Copy constructor /** \param other Other matrix to copy from \param constructor Choose the initialization style */ - CMatrix4( const CMatrix4& other,eConstructor constructor = EM4CONST_COPY); + CMatrix4(const CMatrix4& other, eConstructor constructor = EM4CONST_COPY); //! Simple operator for directly accessing every element of the matrix. T& operator()(const s32 row, const s32 col) @@ -125,17 +124,20 @@ namespace core CMatrix4& operator-=(const CMatrix4& other); //! set this matrix to the product of two matrices + /** Calculate b*a */ inline CMatrix4& setbyproduct(const CMatrix4& other_a,const CMatrix4& other_b ); //! Set this matrix to the product of two matrices - /** no optimization used, + /** Calculate b*a, no optimization used, use it if you know you never have a identity matrix */ CMatrix4& setbyproduct_nocheck(const CMatrix4& other_a,const CMatrix4& other_b ); //! Multiply by another matrix. + /** Calculate other*this */ CMatrix4 operator*(const CMatrix4& other) const; //! Multiply by another matrix. + /** Calculate and return other*this */ CMatrix4& operator*=(const CMatrix4& other); //! Multiply by scalar. @@ -1416,7 +1418,7 @@ namespace core { const f64 h = reciprocal(tan(fieldOfViewRadians*0.5)); _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero - const T w = h / aspectRatio; + const T w = static_cast(h / aspectRatio); _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero M[0] = w; @@ -1455,7 +1457,7 @@ namespace core { const f64 h = reciprocal(tan(fieldOfViewRadians*0.5)); _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero - const T w = (T)(h / aspectRatio); + const T w = static_cast(h / aspectRatio); _IRR_DEBUG_BREAK_IF(zNear==zFar); //divide by zero M[0] = w; @@ -1492,7 +1494,7 @@ namespace core { const f64 h = reciprocal(tan(fieldOfViewRadians*0.5)); _IRR_DEBUG_BREAK_IF(aspectRatio==0.f); //divide by zero - const T w = (T)(h / aspectRatio); + const T w = static_cast(h / aspectRatio); M[0] = w; M[1] = 0; diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index 3c82de55..56b65beb 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ -Tests finished. 52 tests of 52 passed. +Tests finished. 54 tests of 54 passed. Compiled as DEBUG -Test suite pass at GMT Thu Feb 18 11:54:08 2010 +Test suite pass at GMT Thu Mar 11 23:23:09 2010