Fix for coverity #29401
[supertux.git] / src / object / particlesystem.hpp
index 38eac95..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;
 
@@ -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 */