Make S3DVertex::getType a static instead of const function. Same for other vertex classes.

Hopefully this makes it more obvious that we're not dealing with a virtual function here (like all the other getType() functions in Irrlicht).
Should maybe be renamed (classType or classTypeId?).
Also vertexbuffers can now use it without having to create an object first.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5855 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2019-08-17 18:09:07 +00:00
parent 32585c5ed0
commit ede858d56f
3 changed files with 6 additions and 5 deletions

View File

@ -137,7 +137,7 @@ namespace scene
/** \return Type of vertex data. */
virtual video::E_VERTEX_TYPE getVertexType() const _IRR_OVERRIDE_
{
return T().getType();
return T::getType();
}
//! returns position of vertex i

View File

@ -66,7 +66,7 @@ namespace scene
virtual video::S3DVertex* pointer() _IRR_OVERRIDE_ {return Vertices.pointer();}
virtual video::E_VERTEX_TYPE getType() const _IRR_OVERRIDE_ {return T().getType();}
virtual video::E_VERTEX_TYPE getType() const _IRR_OVERRIDE_ {return T::getType();}
};
public:

View File

@ -87,7 +87,8 @@ struct S3DVertex
((Pos == other.Pos) && (Normal == other.Normal) && (Color == other.Color) && (TCoords < other.TCoords)));
}
E_VERTEX_TYPE getType() const
//! Get type of the class
static E_VERTEX_TYPE getType()
{
return EVT_STANDARD;
}
@ -166,7 +167,7 @@ struct S3DVertex2TCoords : public S3DVertex
((static_cast<S3DVertex>(*this) == other) && (TCoords2 < other.TCoords2)));
}
E_VERTEX_TYPE getType() const
static E_VERTEX_TYPE getType()
{
return EVT_2TCOORDS;
}
@ -240,7 +241,7 @@ struct S3DVertexTangents : public S3DVertex
((static_cast<S3DVertex>(*this) == other) && (Tangent == other.Tangent) && (Binormal < other.Binormal)));
}
E_VERTEX_TYPE getType() const
static E_VERTEX_TYPE getType()
{
return EVT_TANGENTS;
}