X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fobject%2Fmoving_sprite.hpp;h=95b5c0508c6e9a388c9405c9392fbb30923b3a04;hb=08813a74da6ac1fd045a105e4e8105f1d7f716f0;hp=d333ce48931bd889b574d80330e058567315f6dc;hpb=f406067af6cbeb0a638078fe1d386d092583909c;p=supertux.git diff --git a/src/object/moving_sprite.hpp b/src/object/moving_sprite.hpp index d333ce489..95b5c0508 100644 --- a/src/object/moving_sprite.hpp +++ b/src/object/moving_sprite.hpp @@ -1,12 +1,10 @@ -// $Id$ -// // SuperTux - MovingSprite Base Class // Copyright (C) 2006 Christoph Sommer // -// 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,21 +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 __MOVING_SPRITE_H__ -#define __MOVING_SPRITE_H__ +// along with this program. If not, see . -#include +#ifndef HEADER_SUPERTUX_OBJECT_MOVING_SPRITE_HPP +#define HEADER_SUPERTUX_OBJECT_MOVING_SPRITE_HPP -#include "moving_object.hpp" -#include "video/drawing_request.hpp" #include "object/anchor_point.hpp" +#include "supertux/moving_object.hpp" +#include "util/reader_fwd.hpp" +#include "video/drawing_request.hpp" -namespace lisp { -class Lisp; -} class Sprite; /** @@ -37,12 +30,23 @@ class Sprite; class MovingSprite : public MovingObject { public: - MovingSprite(const Vector& pos, const std::string& sprite_name, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); - MovingSprite(const lisp::Lisp& reader, const Vector& pos, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); - MovingSprite(const lisp::Lisp& reader, const std::string& sprite_name, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); - MovingSprite(const lisp::Lisp& reader, int layer = LAYER_OBJECTS, CollisionGroup collision_group = COLGROUP_MOVING); + MovingSprite(const Vector& pos, + const std::string& sprite_name, + int layer = LAYER_OBJECTS, + CollisionGroup collision_group = COLGROUP_MOVING); + MovingSprite(const Reader& reader, + const Vector& pos, + int layer = LAYER_OBJECTS, + CollisionGroup collision_group = COLGROUP_MOVING); + MovingSprite(const Reader& reader, + const std::string& sprite_name, + int layer = LAYER_OBJECTS, + CollisionGroup collision_group = COLGROUP_MOVING); + MovingSprite(const Reader& reader, + int layer = LAYER_OBJECTS, + CollisionGroup collision_group = COLGROUP_MOVING); MovingSprite(const MovingSprite& moving_sprite); - MovingSprite& operator=(const MovingSprite& moving_sprite); + //MovingSprite& operator=(const MovingSprite& moving_sprite); ~MovingSprite(); virtual void draw(DrawingContext& context); @@ -50,26 +54,28 @@ public: protected: std::string sprite_name; - Sprite* sprite; + std::auto_ptr sprite; int layer; /**< Sprite's z-position. Refer to video/drawing_context.hpp for sensible values. */ - /** - * set new action for sprite and resize bounding box. - * use with care as you can easily get stuck when resizing the bounding box. - */ + /** set new action for sprite and resize bounding box. use with + care as you can easily get stuck when resizing the bounding box. */ void set_action(const std::string& action, int loops); - /** - * set new action for sprite and re-center bounding box. - * use with care as you can easily get stuck when resizing the bounding box. - */ + /** set new action for sprite and re-center bounding box. use with + care as you can easily get stuck when resizing the bounding + box. */ void set_action_centered(const std::string& action, int loops); - /** - * set new action for sprite and align bounding boxes at anchorPoint. - * use with care as you can easily get stuck when resizing the bounding box. - */ + /** set new action for sprite and align bounding boxes at + anchorPoint. use with care as you can easily get stuck when + resizing the bounding box. */ void set_action(const std::string& action, int loops, AnchorPoint anchorPoint); + +private: + //MovingSprite(const MovingSprite&); + MovingSprite& operator=(const MovingSprite&); }; #endif + +/* EOF */