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:
@@ -15,6 +15,7 @@
|
||||
#include <Nazara/Graphics/Config.hpp>
|
||||
#include <Nazara/Graphics/Enums.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <array>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
@@ -46,6 +47,7 @@ namespace Nz
|
||||
|
||||
static ParticleDeclaration* Get(ParticleLayout layout);
|
||||
static bool IsTypeSupported(ComponentType type);
|
||||
template<typename... Args> static ParticleDeclarationRef New(Args&&... args);
|
||||
|
||||
// Signals:
|
||||
NazaraSignal(OnParticleDeclarationRelease, const ParticleDeclaration* /*particleDeclaration*/);
|
||||
@@ -68,12 +70,14 @@ namespace Nz
|
||||
*/
|
||||
};
|
||||
|
||||
Component m_components[ParticleComponent_Max + 1];
|
||||
std::array<Component, ParticleComponent_Max + 1> m_components;
|
||||
unsigned int m_stride;
|
||||
|
||||
static ParticleDeclaration s_declarations[ParticleLayout_Max + 1];
|
||||
static std::array<ParticleDeclaration, ParticleLayout_Max + 1> s_declarations;
|
||||
static ParticleDeclarationLibrary::LibraryMap s_library;
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Graphics/ParticleDeclaration.inl>
|
||||
|
||||
#endif // NAZARA_PARTICLEDECLARATION_HPP
|
||||
|
||||
18
include/Nazara/Graphics/ParticleDeclaration.inl
Normal file
18
include/Nazara/Graphics/ParticleDeclaration.inl
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright (C) 2016 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <memory>
|
||||
#include <Nazara/Utility/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
template<typename... Args>
|
||||
ParticleDeclarationRef ParticleDeclaration::New(Args&&... args)
|
||||
{
|
||||
std::unique_ptr<ParticleDeclaration> object(new ParticleDeclaration(std::forward<Args>(args)...));
|
||||
return object.release();
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Utility/DebugOff.hpp>
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <Nazara/Core/Signal.hpp>
|
||||
#include <Nazara/Utility/Config.hpp>
|
||||
#include <Nazara/Utility/Enums.hpp>
|
||||
#include <array>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
@@ -69,14 +70,14 @@ namespace Nz
|
||||
*/
|
||||
};
|
||||
|
||||
Component m_components[VertexComponent_Max+1];
|
||||
std::array<Component, VertexComponent_Max + 1> m_components;
|
||||
std::size_t m_stride;
|
||||
|
||||
static VertexDeclaration s_declarations[VertexLayout_Max+1];
|
||||
static std::array<VertexDeclaration, VertexLayout_Max + 1> s_declarations;
|
||||
static VertexDeclarationLibrary::LibraryMap s_library;
|
||||
};
|
||||
}
|
||||
|
||||
#include <Nazara/Utility/VertexDeclaration.hpp>
|
||||
#include <Nazara/Utility/VertexDeclaration.inl>
|
||||
|
||||
#endif // NAZARA_VERTEXDECLARATION_HPP
|
||||
|
||||
Reference in New Issue
Block a user