Improved declarations

Former-commit-id: 567f98b44eada10ffb797cc19cfcdbca584a2461 [formerly 01826c3bfd8385abd6a47f770c7eba7980ae9199] [formerly 6c54c8e8e6a8515387fc61f665bfa5d2cc2d8cdf [formerly f507b9604c2395a4d1eec0f12a07e3cd8b47e4f6]]
Former-commit-id: 1723f76155d68f5aac2006f5ebf5bd96b4ac81e7 [formerly 04f3ed2688c3519923edbb0693e259ee3653256b]
Former-commit-id: e37a8744e6756f5eb331881b422d491171adb362
This commit is contained in:
Lynix
2016-08-02 13:31:09 +02:00
parent 5fa5186480
commit ca1b9c1988
6 changed files with 36 additions and 26 deletions

View File

@@ -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

View 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>