#include "math/vector.hpp"
#include "supertux/game_object.hpp"
#include "util/reader.hpp"
-
-class Surface;
+#include "video/surface_ptr.hpp"
class DisplayManager;
virtual void draw(DrawingContext& context);
protected:
- float max_particle_size;
- int z_pos;
-
class Particle
{
public:
Particle() :
pos(),
+ angle(),
texture()
{}
-
+
virtual ~Particle()
{}
Vector pos;
- Surface* texture;
- };
-
- std::vector<Particle*> particles;
- float virtual_width, virtual_height;
-};
-
-class SnowParticleSystem : public ParticleSystem
-{
-public:
- SnowParticleSystem();
- virtual ~SnowParticleSystem();
+ // angle at which to draw particle
+ float angle;
+ SurfacePtr texture;
- 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;
+ private:
+ Particle(const Particle&);
+ Particle& operator=(const Particle&);
};
- 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;
- };
-
- Surface* cloudimage;
-
-private:
- CloudParticleSystem(const CloudParticleSystem&);
- CloudParticleSystem& operator=(const CloudParticleSystem&);
+ float max_particle_size;
+ int z_pos;
+ std::vector<Particle*> particles;
+ float virtual_width;
+ float virtual_height;
};
#endif