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:
@@ -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>
|
||||
Reference in New Issue
Block a user