Fix for coverity #29401
[supertux.git] / src / object / particlesystem.hpp
index 6671ef0..d02a63b 100644 (file)
@@ -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;
 
@@ -51,93 +50,33 @@ public:
   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();
-
-  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;
-  };
-
-  Surface* snowimages[3];
-};
+    // angle at which to draw particle
+    float angle;
+    SurfacePtr texture;
 
-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;
+  private:
+    Particle(const Particle&);
+    Particle& operator=(const Particle&);
   };
 
-  Surface* ghosts[2];
-};
-
-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;
+  float max_particle_size;
+  int z_pos;
+  std::vector<Particle*> particles;
+  float virtual_width;
+  float virtual_height;
 };
 
 #endif