Utility/MeshParam: Use constref instead of pointer
This commit is contained in:
parent
e0bdd35280
commit
995dfddafa
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
Nazara Engine:
|
Nazara Engine:
|
||||||
- VertexMapper:GetComponentPtr no longer throw an error if component is disabled or incompatible with template type, instead a null pointer is returned.
|
- VertexMapper:GetComponentPtr no longer throw an error if component is disabled or incompatible with template type, instead a null pointer is returned.
|
||||||
|
- MeshParams now hold a ConstRef to the VertexDeclaration (preventing it to be freed before usage)
|
||||||
|
|
||||||
# 0.4:
|
# 0.4:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace Nz
|
||||||
* If the declaration has a Vector3f Normals component enabled, Normals are generated.
|
* If the declaration has a Vector3f Normals component enabled, Normals are generated.
|
||||||
* If the declaration has a Vector3f Tangents component enabled, Tangents are generated.
|
* If the declaration has a Vector3f Tangents component enabled, Tangents are generated.
|
||||||
*/
|
*/
|
||||||
VertexDeclaration* vertexDeclaration = VertexDeclaration::Get(VertexLayout_XYZ_Normal_UV_Tangent);
|
VertexDeclarationConstRef vertexDeclaration = VertexDeclaration::Get(VertexLayout_XYZ_Normal_UV_Tangent);
|
||||||
|
|
||||||
bool IsValid() const;
|
bool IsValid() const;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ namespace Nz
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vertexDeclaration == nullptr)
|
if (!vertexDeclaration)
|
||||||
{
|
{
|
||||||
NazaraError("The vertex declaration can't be null");
|
NazaraError("The vertex declaration can't be null");
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue