X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fparticlesystem.hpp;h=32259b16c2f74a13f7e6314e834def6598a34334;hb=78ac7aef674f518549f96160c6354b589553f952;hp=b3f49a5adb173e99a298a752c55e3e0b58e7f639;hpb=fea3446f05e1e7673607b835c269d3e8d1929ab3;p=supertux.git diff --git a/src/object/particlesystem.hpp b/src/object/particlesystem.hpp index b3f49a5ad..32259b16c 100644 --- a/src/object/particlesystem.hpp +++ b/src/object/particlesystem.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,18 @@ // 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. +// along with this program. If not, see . -#ifndef SUPERTUX_PARTICLESYSTEM_H -#define SUPERTUX_PARTICLESYSTEM_H +#ifndef HEADER_SUPERTUX_OBJECT_PARTICLESYSTEM_HPP +#define HEADER_SUPERTUX_OBJECT_PARTICLESYSTEM_HPP #include -#include "video/surface.hpp" -#include "game_object.hpp" -#include "serializable.hpp" -#include "sector.hpp" #include "math/vector.hpp" +#include "supertux/game_object.hpp" +#include "util/reader.hpp" -namespace lisp { -class Lisp; -} - +class Surface; class DisplayManager; /** @@ -52,102 +44,38 @@ class DisplayManager; class ParticleSystem : public GameObject { public: - ParticleSystem(float max_particle_size = 60); - virtual ~ParticleSystem(); + ParticleSystem(float max_particle_size = 60); + virtual ~ParticleSystem(); - virtual void draw(DrawingContext& context); + virtual void draw(DrawingContext& context); protected: - float max_particle_size; - int z_pos; - - class Particle - { - public: - virtual ~Particle() - { } - - Vector pos; - Surface* texture; - }; - - std::vector particles; - float virtual_width, virtual_height; -}; - -class SnowParticleSystem : public ParticleSystem, public Serializable -{ -public: - SnowParticleSystem(); - virtual ~SnowParticleSystem(); - - void parse(const lisp::Lisp& lisp); - void write(lisp::Writer& writer); - - 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]; -}; - -class GhostParticleSystem : public ParticleSystem, public Serializable -{ -public: - GhostParticleSystem(); - virtual ~GhostParticleSystem(); - - void parse(const lisp::Lisp& lisp); - void write(lisp::Writer& writer); - - virtual void update(float elapsed_time); - - std::string type() const - { return "GhostParticleSystem"; } - -private: - class GhostParticle : public Particle - { - public: - float speed; - }; - - Surface* ghosts[2]; -}; - -class CloudParticleSystem : public ParticleSystem, public Serializable -{ -public: - CloudParticleSystem(); - virtual ~CloudParticleSystem(); - - void parse(const lisp::Lisp& lisp); - void write(lisp::Writer& writer); - - virtual void update(float elapsed_time); - - std::string type() const - { return "CloudParticleSystem"; } - -private: - class CloudParticle : public Particle - { - public: - float speed; - }; - - Surface* cloudimage; + class Particle + { + public: + Particle() : + pos(), + texture() + {} + + virtual ~Particle() + {} + + Vector pos; + Surface* texture; + + private: + Particle(const Particle&); + Particle& operator=(const Particle&); + }; + + float max_particle_size; + int z_pos; + std::vector particles; + float virtual_width; + float virtual_height; }; #endif + +/* EOF */