Use boost::shared_ptr<Surface> instead of std::auto_ptr<Surface>
[supertux.git] / src / object / background.hpp
index 2b4e2eb..4c55d7c 100644 (file)
@@ -43,6 +43,19 @@ public:
   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;
@@ -52,9 +65,9 @@ private:
   float speed_y; /**< scroll-speed in vertical direction */
   Vector scroll_speed;
   Vector scroll_offset;
-  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 */
+  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*/