diff options
author | Stijn Buys <ingar@osirion.org> | 2013-01-20 21:37:11 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-01-20 21:37:11 +0000 |
commit | d4f9da2f3c19511b028da2569d7b6a8d1371e135 (patch) | |
tree | e1bba0d8dd3b15169612f865612d3fca6475639a /src/render/particlesystemscript.h | |
parent | 4feff2411d1b703a3b93d8a342112bd998b1ffed (diff) |
Major overhaul of the particle system back-end, support multiple ejectors per particle system.
Diffstat (limited to 'src/render/particlesystemscript.h')
-rw-r--r-- | src/render/particlesystemscript.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/render/particlesystemscript.h b/src/render/particlesystemscript.h new file mode 100644 index 0000000..d4a7d9b --- /dev/null +++ b/src/render/particlesystemscript.h @@ -0,0 +1,66 @@ +/* + render/particlesystemscript.h + This file is part of the Osirion project and is distributed under + the terms of the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_RENDER_PARTICLESYSTEMSCRIPT_H__ +#define __INCLUDED_RENDER_PARTICLESYSTEMSCRIPT_H__ + +#include "math/axis.h" +#include "math/color.h" +#include "math/vector3f.h" +#include "core/entity.h" +#include "model/tags.h" +#include "render/particleejectorscript.h" + +namespace render +{ + +/* ---- class ParticleSystemScript --------------------------------------- */ + +/** + * @brief a ParticleSystemScript holds the definition for a complete particle system. + * A script can hold the one ore more ejector definitions, and + * all required parameters are read from a .ini file. + * */ +class ParticleSystemScript +{ +public: + typedef std::list<ParticleEjectorScript *> Ejectors; + + inline const std::string &label() const { + return script_label; + } + + ParticleEjectorScript *add_ejector(); + + inline const Ejectors &ejectors() const { + return script_ejectors; + } + + static ParticleSystemScript *load(const std::string &label); + + static ParticleSystemScript *find(const std::string &label); + + static void clear(); + + static void list(); + +private: + + ParticleSystemScript(const std::string & label); + + ~ParticleSystemScript(); + + std::string script_label; + Ejectors script_ejectors; + + typedef std::map<std::string, ParticleSystemScript *> Registry; + + static Registry script_registry; +}; + +} // namespace render + +#endif // __INCLUDED_RENDER_PARTICLESYSTEMSCRIPT_H__ |