Avoid ambigious conversions when compiling with c++20

Yay, more ugly casts needed.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6427 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2022-09-25 11:18:55 +00:00
parent 389ec11a58
commit 582bb54ce2

View File

@ -150,21 +150,21 @@ struct S3DVertex2TCoords : public S3DVertex
//! Equality operator //! Equality operator
bool operator==(const S3DVertex2TCoords& other) const bool operator==(const S3DVertex2TCoords& other) const
{ {
return ((static_cast<S3DVertex>(*this)==other) && return ((static_cast<S3DVertex>(*this)==static_cast<const S3DVertex&>(other)) &&
(TCoords2 == other.TCoords2)); (TCoords2 == other.TCoords2));
} }
//! Inequality operator //! Inequality operator
bool operator!=(const S3DVertex2TCoords& other) const bool operator!=(const S3DVertex2TCoords& other) const
{ {
return ((static_cast<S3DVertex>(*this)!=other) || return ((static_cast<S3DVertex>(*this)!=static_cast<const S3DVertex&>(other)) ||
(TCoords2 != other.TCoords2)); (TCoords2 != other.TCoords2));
} }
bool operator<(const S3DVertex2TCoords& other) const bool operator<(const S3DVertex2TCoords& other) const
{ {
return ((static_cast<S3DVertex>(*this) < other) || return ((static_cast<S3DVertex>(*this) < other) ||
((static_cast<S3DVertex>(*this) == other) && (TCoords2 < other.TCoords2))); ((static_cast<S3DVertex>(*this) == static_cast<const S3DVertex&>(other)) && (TCoords2 < other.TCoords2)));
} }
static E_VERTEX_TYPE getType() static E_VERTEX_TYPE getType()
@ -225,14 +225,14 @@ struct S3DVertexTangents : public S3DVertex
bool operator==(const S3DVertexTangents& other) const bool operator==(const S3DVertexTangents& other) const
{ {
return ((static_cast<S3DVertex>(*this)==other) && return ((static_cast<S3DVertex>(*this)==static_cast<const S3DVertex&>(other)) &&
(Tangent == other.Tangent) && (Tangent == other.Tangent) &&
(Binormal == other.Binormal)); (Binormal == other.Binormal));
} }
bool operator!=(const S3DVertexTangents& other) const bool operator!=(const S3DVertexTangents& other) const
{ {
return ((static_cast<S3DVertex>(*this)!=other) || return ((static_cast<S3DVertex>(*this)!=static_cast<const S3DVertex&>(other)) ||
(Tangent != other.Tangent) || (Tangent != other.Tangent) ||
(Binormal != other.Binormal)); (Binormal != other.Binormal));
} }
@ -240,8 +240,8 @@ struct S3DVertexTangents : public S3DVertex
bool operator<(const S3DVertexTangents& other) const bool operator<(const S3DVertexTangents& other) const
{ {
return ((static_cast<S3DVertex>(*this) < other) || return ((static_cast<S3DVertex>(*this) < other) ||
((static_cast<S3DVertex>(*this) == other) && (Tangent < other.Tangent)) || ((static_cast<S3DVertex>(*this) == static_cast<const S3DVertex&>(other)) && (Tangent < other.Tangent)) ||
((static_cast<S3DVertex>(*this) == other) && (Tangent == other.Tangent) && (Binormal < other.Binormal))); ((static_cast<S3DVertex>(*this) == static_cast<const S3DVertex&>(other)) && (Tangent == other.Tangent) && (Binormal < other.Binormal)));
} }
static E_VERTEX_TYPE getType() static E_VERTEX_TYPE getType()