Improved declarations
Former-commit-id: fae51c9344fd88a35b6c6ebb825ba71e6ca33f1a [formerly 75901e046e5bbe5732846eed7ba7cdc3ebcc7bb2] [formerly c14ba82b5e7849ff610789fc4dca09aa67907200 [formerly f9dd4fd281c9b68aff9affef037d5ce1a3802fd7]] Former-commit-id: 88f4d343858f42b06420f593efa6a481018e05fb [formerly 09a6ba61ac09ded89c59612aec2ab7263eb75e36] Former-commit-id: 6268a2a01d13a27f79f18f6282023cac1a8579d4
This commit is contained in:
@@ -38,9 +38,9 @@ namespace Nz
|
||||
|
||||
ParticleDeclaration::ParticleDeclaration(const ParticleDeclaration& declaration) :
|
||||
RefCounted(),
|
||||
m_components(declaration.m_components),
|
||||
m_stride(declaration.m_stride)
|
||||
{
|
||||
std::memcpy(m_components, declaration.m_components, sizeof(Component) * (ParticleComponent_Max + 1));
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -205,7 +205,7 @@ namespace Nz
|
||||
|
||||
ParticleDeclaration& ParticleDeclaration::operator=(const ParticleDeclaration& declaration)
|
||||
{
|
||||
std::memcpy(m_components, declaration.m_components, sizeof(Component) * (ParticleComponent_Max + 1));
|
||||
m_components = declaration.m_components;
|
||||
m_stride = declaration.m_stride;
|
||||
|
||||
return *this;
|
||||
@@ -222,13 +222,7 @@ namespace Nz
|
||||
|
||||
ParticleDeclaration* ParticleDeclaration::Get(ParticleLayout layout)
|
||||
{
|
||||
#ifdef NAZARA_DEBUG
|
||||
if (layout > ParticleLayout_Max)
|
||||
{
|
||||
NazaraError("Particle layout out of enum");
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
NazaraAssert(layout <= ParticleLayout_Max, "Particle layout out of enum");
|
||||
|
||||
return &s_declarations[layout];
|
||||
}
|
||||
@@ -338,6 +332,6 @@ namespace Nz
|
||||
ParticleDeclarationLibrary::Uninitialize();
|
||||
}
|
||||
|
||||
ParticleDeclaration ParticleDeclaration::s_declarations[ParticleLayout_Max + 1];
|
||||
std::array<ParticleDeclaration, ParticleLayout_Max + 1> ParticleDeclaration::s_declarations;
|
||||
ParticleDeclarationLibrary::LibraryMap ParticleDeclaration::s_library;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,6 @@ namespace Nz
|
||||
|
||||
MTLParser::Material* material = mtlFormat.AddMaterial(name);
|
||||
|
||||
bool bValue;
|
||||
String strVal;
|
||||
if (matData.HasParameter(MaterialData::CustomDefined))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user