X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fparticlesystem_interactive.hpp;h=991fff74d689007cdfa5314313666805b0ddb92a;hb=3aa6936791cf24344e27d452ab2fd8c33fb5a2e8;hp=6da680595314d0a10ee15b4b501690cba788c815;hpb=07ddaed2a657e4d2a3d038fed223fc5827159caf;p=supertux.git diff --git a/src/object/particlesystem_interactive.hpp b/src/object/particlesystem_interactive.hpp index 6da680595..991fff74d 100644 --- a/src/object/particlesystem_interactive.hpp +++ b/src/object/particlesystem_interactive.hpp @@ -1,12 +1,10 @@ -// $Id$ -// // SuperTux // Copyright (C) 2006 Matthias Braun // -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -14,24 +12,16 @@ // GNU General Public License for more details. // // 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_INTERACTIVE_H -#define SUPERTUX_PARTICLESYSTEM_INTERACTIVE_H +// along with this program. If not, see . -#include +#ifndef HEADER_SUPERTUX_OBJECT_PARTICLESYSTEM_INTERACTIVE_HPP +#define HEADER_SUPERTUX_OBJECT_PARTICLESYSTEM_INTERACTIVE_HPP -#include "video/surface.hpp" -#include "game_object.hpp" -#include "serializable.hpp" -#include "sector.hpp" #include "math/vector.hpp" +#include "supertux/game_object.hpp" +#include "supertux/sector.hpp" -namespace lisp { -class Lisp; -} - +class Surface; class DisplayManager; /** @@ -48,76 +38,98 @@ class DisplayManager; class ParticleSystem_Interactive : public GameObject { public: - ParticleSystem_Interactive(); - virtual ~ParticleSystem_Interactive(); - - virtual void draw(DrawingContext& context); + ParticleSystem_Interactive(); + virtual ~ParticleSystem_Interactive(); + + virtual void draw(DrawingContext& context); protected: - int layer; - - class Particle - { - public: - virtual ~Particle() - { } - - Vector pos; - Surface* texture; - }; - - std::vector particles; - float virtual_width, virtual_height; - int collision(Particle* particle, Vector movement); + class Particle + { + public: + Particle() : + pos(), + texture() + {} + + virtual ~Particle() + {} + + Vector pos; + Surface* texture; + }; + + int collision(Particle* particle, Vector movement); + + int z_pos; + std::vector particles; + float virtual_width; + float virtual_height; }; -class RainParticleSystem : public ParticleSystem_Interactive, public Serializable +class RainParticleSystem : public ParticleSystem_Interactive { public: - RainParticleSystem(); - virtual ~RainParticleSystem(); + RainParticleSystem(); + virtual ~RainParticleSystem(); + + void parse(const Reader& lisp); + + virtual void update(float elapsed_time); + + std::string type() const + { return "RainParticleSystem"; } - void parse(const lisp::Lisp& lisp); - void write(lisp::Writer& writer); +private: + class RainParticle : public Particle + { + public: + float speed; + + RainParticle() : + speed() + {} + }; - virtual void update(float elapsed_time); + Surface* rainimages[2]; - std::string type() const - { return "RainParticleSystem"; } - private: - class RainParticle : public Particle - { - public: - float speed; - }; - - Surface* rainimages[2]; + RainParticleSystem(const RainParticleSystem&); + RainParticleSystem& operator=(const RainParticleSystem&); }; -class CometParticleSystem : public ParticleSystem_Interactive, public Serializable +class CometParticleSystem : public ParticleSystem_Interactive { public: - CometParticleSystem(); - virtual ~CometParticleSystem(); + CometParticleSystem(); + virtual ~CometParticleSystem(); + + void parse(const Reader& lisp); + void write(lisp::Writer& writer); + + virtual void update(float elapsed_time); + + std::string type() const + { return "CometParticleSystem"; } + +private: + class CometParticle : public Particle + { + public: + float speed; - void parse(const lisp::Lisp& lisp); - void write(lisp::Writer& writer); + CometParticle() : + speed() + {} + }; - virtual void update(float elapsed_time); + Surface* cometimages[2]; - std::string type() const - { return "CometParticleSystem"; } - private: - class CometParticle : public Particle - { - public: - float speed; - }; - - Surface* cometimages[2]; + CometParticleSystem(const CometParticleSystem&); + CometParticleSystem& operator=(const CometParticleSystem&); }; #endif +/* EOF */