Improved declarations

Former-commit-id: 19169e7acc6fd5d7ea7399ec9b2614c028a1dfd2 [formerly c383d9fbf62f8868d0834dcdd08a1f7b7f3ff81a] [formerly 4633f0bfb8c049bc2ce10ea2aa47684c7ae7a030 [formerly 4a92fd2e96b20daedf2d04006053e7600c60cd79]]
Former-commit-id: fcb2bfac13cdc0d6cf5d7b9c19a5cf11b04874c1 [formerly b631d69d2d2795c3bd60bc89085579087df6b73b]
Former-commit-id: 105a4d1bb3e05266c8c5cde7f87e14444a5de49c
This commit is contained in:
Lynix
2016-08-02 13:31:09 +02:00
parent 76818335ff
commit 5b83ac044b
6 changed files with 36 additions and 26 deletions

View File

@@ -120,7 +120,6 @@ namespace Nz
MTLParser::Material* material = mtlFormat.AddMaterial(name);
bool bValue;
String strVal;
if (matData.HasParameter(MaterialData::CustomDefined))
{

View File

@@ -22,9 +22,9 @@ namespace Nz
VertexDeclaration::VertexDeclaration(const VertexDeclaration& declaration) :
RefCounted(),
m_components(declaration.m_components),
m_stride(declaration.m_stride)
{
std::memcpy(m_components, declaration.m_components, sizeof(Component)*(VertexComponent_Max+1));
}
VertexDeclaration::~VertexDeclaration()
@@ -133,7 +133,7 @@ namespace Nz
VertexDeclaration& VertexDeclaration::operator=(const VertexDeclaration& declaration)
{
std::memcpy(m_components, declaration.m_components, sizeof(Component)*(VertexComponent_Max+1));
m_components = declaration.m_components;
m_stride = declaration.m_stride;
return *this;
@@ -141,13 +141,7 @@ namespace Nz
VertexDeclaration* VertexDeclaration::Get(VertexLayout layout)
{
#ifdef NAZARA_DEBUG
if (layout > VertexLayout_Max)
{
NazaraError("Vertex layout out of enum");
return nullptr;
}
#endif
NazaraAssert(layout <= VertexLayout_Max, "Vertex layout out of enum");
return &s_declarations[layout];
}
@@ -301,6 +295,6 @@ namespace Nz
VertexDeclarationLibrary::Uninitialize();
}
VertexDeclaration VertexDeclaration::s_declarations[VertexLayout_Max+1];
std::array<VertexDeclaration, VertexLayout_Max + 1> VertexDeclaration::s_declarations;
VertexDeclarationLibrary::LibraryMap VertexDeclaration::s_library;
}