#ifndef __BACKGROUND_H__
#define __BACKGROUND_H__
-#include "texture.h"
+#include "screen/texture.h"
+#include "screen/drawing_context.h"
#include "game_object.h"
-#include "drawable.h"
-
-enum {
- BACKGROUND_GRADIENT,
- BACKGROUND_IMAGE
-};
class DisplayManager;
-class Background : public GameObject, public Drawable
+class Background : public GameObject
{
public:
- Background(DisplayManager& displaymanager);
+ Background();
virtual ~Background();
- void set_image(Surface* image, float bkgd_speed);
+ void set_image(const std::string& name, float bkgd_speed);
void set_gradient(Color top, Color bottom);
virtual void action(float elapsed_time);
- virtual void draw(Camera& viewport, int layer);
+ virtual void draw(DrawingContext& context);
private:
- int bgtype;
+ enum Type {
+ INVALID, GRADIENT, IMAGE
+ };
+
+ Type type;
float speed;
Surface* image;
Color gradient_top, gradient_bottom;