X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fbackground.hpp;h=3321c923cc6d84a07c55ead52108e83d9d4f30c2;hb=ca967dcf4ee89f99880355be00782d1cd047be6a;hp=dc7a6d6e6073d5fa3ccece7f1111acea710f3944;hpb=5b7f9214cb929399f1a855ef5807018a9447d510;p=supertux.git diff --git a/src/object/background.hpp b/src/object/background.hpp index dc7a6d6e6..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,33 +43,26 @@ 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; - float speed; - Surface* image; - Color gradient_top, gradient_bottom; + std::string imagefile_bottom; + Vector pos; /**< coordinates of upper-left corner of image */ + float speed; /**< scroll-speed in horizontal direction */ + float speed_y; /**< scroll-speed in vertical direction */ + 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*/ -