]> git.lizzy.rs Git - irrlicht.git/commitdiff
Avoid ambigious conversions when compiling with c++20
authorcutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475>
Sun, 25 Sep 2022 11:18:55 +0000 (11:18 +0000)
committersfan5 <sfan5@live.de>
Fri, 24 Mar 2023 16:09:11 +0000 (17:09 +0100)
Yay, more ugly casts needed.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6427 dfc29bdd-3216-0410-991c-e03cc46cb475

include/S3DVertex.h

index 3d78e2037f934f92b8b95ec125be7183833c8545..aba81a79567d5542d7037e866bee4f9491390810 100644 (file)
@@ -25,7 +25,7 @@ enum E_VERTEX_TYPE
        EVT_2TCOORDS,\r
 \r
        //! Vertex with a tangent and binormal vector, video::S3DVertexTangents.\r
-       /** Usually used for tangent space normal mapping. \r
+       /** Usually used for tangent space normal mapping.\r
                Usually tangent and binormal get send to shaders as texture coordinate sets 1 and 2.\r
        */\r
        EVT_TANGENTS\r
@@ -150,21 +150,21 @@ struct S3DVertex2TCoords : public S3DVertex
        //! Equality operator\r
        bool operator==(const S3DVertex2TCoords& other) const\r
        {\r
-               return ((static_cast<S3DVertex>(*this)==other) &&\r
+               return ((static_cast<S3DVertex>(*this)==static_cast<const S3DVertex&>(other)) &&\r
                        (TCoords2 == other.TCoords2));\r
        }\r
 \r
        //! Inequality operator\r
        bool operator!=(const S3DVertex2TCoords& other) const\r
        {\r
-               return ((static_cast<S3DVertex>(*this)!=other) ||\r
+               return ((static_cast<S3DVertex>(*this)!=static_cast<const S3DVertex&>(other)) ||\r
                        (TCoords2 != other.TCoords2));\r
        }\r
 \r
        bool operator<(const S3DVertex2TCoords& other) const\r
        {\r
                return ((static_cast<S3DVertex>(*this) < other) ||\r
-                               ((static_cast<S3DVertex>(*this) == other) && (TCoords2 < other.TCoords2)));\r
+                               ((static_cast<S3DVertex>(*this) == static_cast<const S3DVertex&>(other)) && (TCoords2 < other.TCoords2)));\r
        }\r
 \r
        static E_VERTEX_TYPE getType()\r
@@ -186,7 +186,7 @@ struct S3DVertex2TCoords : public S3DVertex
 \r
 \r
 //! Vertex with a tangent and binormal vector.\r
-/** Usually used for tangent space normal mapping. \r
+/** Usually used for tangent space normal mapping.\r
        Usually tangent and binormal get send to shaders as texture coordinate sets 1 and 2.\r
 */\r
 struct S3DVertexTangents : public S3DVertex\r
@@ -225,14 +225,14 @@ struct S3DVertexTangents : public S3DVertex
 \r
        bool operator==(const S3DVertexTangents& other) const\r
        {\r
-               return ((static_cast<S3DVertex>(*this)==other) &&\r
+               return ((static_cast<S3DVertex>(*this)==static_cast<const S3DVertex&>(other)) &&\r
                        (Tangent == other.Tangent) &&\r
                        (Binormal == other.Binormal));\r
        }\r
 \r
        bool operator!=(const S3DVertexTangents& other) const\r
        {\r
-               return ((static_cast<S3DVertex>(*this)!=other) ||\r
+               return ((static_cast<S3DVertex>(*this)!=static_cast<const S3DVertex&>(other)) ||\r
                        (Tangent != other.Tangent) ||\r
                        (Binormal != other.Binormal));\r
        }\r
@@ -240,8 +240,8 @@ struct S3DVertexTangents : public S3DVertex
        bool operator<(const S3DVertexTangents& other) const\r
        {\r
                return ((static_cast<S3DVertex>(*this) < other) ||\r
-                               ((static_cast<S3DVertex>(*this) == other) && (Tangent < other.Tangent)) ||\r
-                               ((static_cast<S3DVertex>(*this) == other) && (Tangent == other.Tangent) && (Binormal < other.Binormal)));\r
+                               ((static_cast<S3DVertex>(*this) == static_cast<const S3DVertex&>(other)) && (Tangent < other.Tangent)) ||\r
+                               ((static_cast<S3DVertex>(*this) == static_cast<const S3DVertex&>(other)) && (Tangent == other.Tangent) && (Binormal < other.Binormal)));\r
        }\r
 \r
        static E_VERTEX_TYPE getType()\r