X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fobject%2Fparticlesystem.hpp;h=d02a63be21cef9ec351fd3ee1e82a83bfcf4371a;hb=64842a0700a2ee8a3d2d61ad2685217f5060985a;hp=38eac952685a4b13c8c44ef195aa329418edf3f4;hpb=5e563be3e14901671d5c506ffe13033164657c6d;p=supertux.git diff --git a/src/object/particlesystem.hpp b/src/object/particlesystem.hpp index 38eac9526..d02a63be2 100644 --- a/src/object/particlesystem.hpp +++ b/src/object/particlesystem.hpp @@ -22,8 +22,7 @@ #include "math/vector.hpp" #include "supertux/game_object.hpp" #include "util/reader.hpp" - -class Surface; +#include "video/surface_ptr.hpp" class DisplayManager; @@ -56,14 +55,17 @@ protected: public: Particle() : pos(), + angle(), texture() {} - + virtual ~Particle() {} Vector pos; - Surface* texture; + // angle at which to draw particle + float angle; + SurfacePtr texture; private: Particle(const Particle&); @@ -77,105 +79,6 @@ protected: float virtual_height; }; -class SnowParticleSystem : public ParticleSystem -{ -public: - SnowParticleSystem(); - virtual ~SnowParticleSystem(); - - void parse(const Reader& lisp); - - virtual void update(float elapsed_time); - - std::string type() const - { return "SnowParticleSystem"; } - -private: - class SnowParticle : public Particle - { - public: - float speed; - float wobble; - float anchorx; - float drift_speed; - - SnowParticle() : - speed(), - wobble(), - anchorx(), - drift_speed() - {} - }; - - Surface* snowimages[3]; - -private: - SnowParticleSystem(const SnowParticleSystem&); - SnowParticleSystem& operator=(const SnowParticleSystem&); -}; - -class GhostParticleSystem : public ParticleSystem -{ -public: - GhostParticleSystem(); - virtual ~GhostParticleSystem(); - - void parse(const Reader& lisp); - - virtual void update(float elapsed_time); - - std::string type() const - { return "GhostParticleSystem"; } - -private: - class GhostParticle : public Particle - { - public: - float speed; - - GhostParticle() : - speed() - {} - }; - - Surface* ghosts[2]; - -private: - GhostParticleSystem(const GhostParticleSystem&); - GhostParticleSystem& operator=(const GhostParticleSystem&); -}; - -class CloudParticleSystem : public ParticleSystem -{ -public: - CloudParticleSystem(); - virtual ~CloudParticleSystem(); - - void parse(const Reader& lisp); - - virtual void update(float elapsed_time); - - std::string type() const - { return "CloudParticleSystem"; } - -private: - class CloudParticle : public Particle - { - public: - float speed; - - CloudParticle() : - speed() - {} - }; - - Surface* cloudimage; - -private: - CloudParticleSystem(const CloudParticleSystem&); - CloudParticleSystem& operator=(const CloudParticleSystem&); -}; - #endif /* EOF */