X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fbackground.hpp;h=3321c923cc6d84a07c55ead52108e83d9d4f30c2;hb=ae7bd4f460fdd93934fc0abc9589758a49309bda;hp=28b14cf3ea8ab5472abdc8047757ef3257257d3a;hpb=c47436162e37fecd71763c471f92da01fae7ef3c;p=supertux.git diff --git a/src/object/background.hpp b/src/object/background.hpp index 28b14cf3e..3321c923c 100644 --- a/src/object/background.hpp +++ b/src/object/background.hpp @@ -1,7 +1,7 @@ // $Id$ // -// SuperTux - A Jump'n Run -// Copyright (C) 2004 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -16,9 +16,11 @@ // 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_BACKGROUND_H #define SUPERTUX_BACKGROUND_H +#include #include "video/surface.hpp" #include "video/drawing_context.hpp" #include "game_object.hpp" @@ -41,27 +43,16 @@ public: void set_image(const std::string& name, float bkgd_speed); - void set_gradient(Color top, Color bottom); - std::string get_image() const - { return imagefile; } + { return imagefile; } float get_speed() const - { return speed; } - Color get_gradient_top() const - { return gradient_top; } - Color get_gradient_bottom() const - { return gradient_bottom; } + { return speed; } virtual void update(float elapsed_time); virtual void draw(DrawingContext& context); private: - enum Type { - INVALID, GRADIENT, IMAGE - }; - - Type type; int layer; std::string imagefile_top; std::string imagefile; @@ -69,11 +60,9 @@ private: Vector pos; /**< coordinates of upper-left corner of image */ float speed; /**< scroll-speed in horizontal direction */ float speed_y; /**< scroll-speed in vertical direction */ - Surface* image_top; /**< image to draw above pos */ - Surface* image; /**< image to draw, anchored at pos */ - Surface* image_bottom; /**< image to draw below pos+ */ - Color gradient_top, gradient_bottom; + std::auto_ptr image_top; /**< image to draw above pos */ + std::auto_ptr image; /**< image to draw, anchored at pos */ + std::auto_ptr image_bottom; /**< image to draw below pos+screenheight */ }; #endif /*SUPERTUX_BACKGROUND_H*/ -