Fix for uninitialized members
[supertux.git] / src / object / background.hpp
index ca97358..632b8f3 100644 (file)
@@ -40,8 +40,22 @@ public:
   virtual void update(float elapsed_time);
 
   virtual void draw(DrawingContext& context);
+  void draw_image(DrawingContext& context, const Vector& pos);
 
 private:
+  enum Alignment {
+    NO_ALIGNMENT,
+    LEFT_ALIGNMENT,
+    RIGHT_ALIGNMENT,
+    TOP_ALIGNMENT,
+    BOTTOM_ALIGNMENT
+  };
+
+  /** Backgrounds with NO_ALIGNMENT are repeated over the whole
+      screen, backgrounds with left, right, top, bottom alignment are
+      only repeated in one direction and attached to the level edge */
+  Alignment alignment;
+
   int layer;
   std::string imagefile_top;
   std::string imagefile;
@@ -49,9 +63,11 @@ 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 */
-  std::auto_ptr<Surface> image_top; /**< image to draw above pos */
-  std::auto_ptr<Surface> image; /**< image to draw, anchored at pos */
-  std::auto_ptr<Surface> image_bottom; /**< image to draw below pos+screenheight */
+  Vector scroll_speed;
+  Vector scroll_offset;
+  SurfacePtr image_top; /**< image to draw above pos */
+  SurfacePtr image; /**< image to draw, anchored at pos */
+  SurfacePtr image_bottom; /**< image to draw below pos+screenheight */
 };
 
 #endif /*SUPERTUX_BACKGROUND_H*/