From d4f9da2f3c19511b028da2569d7b6a8d1371e135 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 20 Jan 2013 21:37:11 +0000 Subject: Major overhaul of the particle system back-end, support multiple ejectors per particle system. --- src/render/particlesystemscript.h | 66 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/render/particlesystemscript.h (limited to 'src/render/particlesystemscript.h') 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 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 Registry; + + static Registry script_registry; +}; + +} // namespace render + +#endif // __INCLUDED_RENDER_PARTICLESYSTEMSCRIPT_H__ -- cgit v1.2.3