X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fparticlesystem.h;h=23d9e293c420daf064009062856638c4b87cbbc4;hb=eb7c6ccdd326f6bceb67cd5259015dd994b04928;hp=d11c5c13daaf309f2b3dda963862847d2365924e;hpb=6f801c22d97251799740317fb1d0caf2e744b321;p=supertux.git diff --git a/src/object/particlesystem.h b/src/object/particlesystem.h index d11c5c13d..23d9e293c 100644 --- a/src/object/particlesystem.h +++ b/src/object/particlesystem.h @@ -16,20 +16,17 @@ // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - #ifndef SUPERTUX_PARTICLESYSTEM_H #define SUPERTUX_PARTICLESYSTEM_H #include #include "video/surface.h" -#include "special/game_object.h" +#include "game_object.h" #include "serializable.h" -using namespace SuperTux; - -namespace SuperTux { -class LispReader; +namespace lisp { +class Lisp; } class DisplayManager; @@ -40,7 +37,7 @@ class DisplayManager; * layer where it should be drawn and a texture. * The coordinate system used here is a virtual one. It would be a bad idea to * populate whole levels with particles. So we're using a virtual rectangle - * here that is tiled onto the level when drawing. This rectangle has the size + * here that is tiled onto the level when drawing. This rect.has the size * (virtual_width, virtual_height). We're using modulo on the particle * coordinates, so when a particle leaves left, it'll reenter at the right * side. @@ -80,8 +77,8 @@ public: SnowParticleSystem(); virtual ~SnowParticleSystem(); - void parse(LispReader& reader); - void write(LispWriter& writer); + void parse(const lisp::Lisp& lisp); + void write(lisp::Writer& writer); virtual void action(float elapsed_time); @@ -98,14 +95,38 @@ private: Surface* snowimages[3]; }; +class RainParticleSystem : public ParticleSystem, public Serializable +{ +public: + RainParticleSystem(); + virtual ~RainParticleSystem(); + + void parse(const lisp::Lisp& lisp); + void write(lisp::Writer& writer); + + virtual void action(float elapsed_time); + + std::string type() const + { return "RainParticleSystem"; } + +private: + class RainParticle : public Particle + { + public: + float speed; + }; + + Surface* rainimages[2]; +}; + class CloudParticleSystem : public ParticleSystem, public Serializable { public: CloudParticleSystem(); virtual ~CloudParticleSystem(); - void parse(LispReader& reader); - void write(LispWriter& writer); + void parse(const lisp::Lisp& lisp); + void write(lisp::Writer& writer); virtual void action(float elapsed_time);