home *** CD-ROM | disk | FTP | other *** search
- #ifndef SCENE2D_H
- #define SCENE2D_H
-
- class Object2D;
- class Color;
- class Hardware2D;
- class HardwarePicture2D;
- #include <list>
- #include <vector>
-
- class Scene2D
- {
- public:
- explicit Scene2D(Hardware2D * hardware);
- virtual ~Scene2D();
-
- static int hidden_layer()
- {
- return 1000;
- }
- bool render(int camera_x, int camera_y, const Color & back_color);
-
- void push_shift_add(int shx, int shy);
- void pop_shift();
-
- HardwarePicture2D * load_picture(const Color * colors, unsigned width, unsigned height, unsigned stride);
- void blit(HardwarePicture2D * pic, int alpha);
-
- void remove_object2d(Object2D * obj);
- void add_object2d(Object2D * obj);
-
- private:
- Hardware2D * hardware;
- std::list<Object2D *> object_list;
-
- struct Shift
- {
- int x;
- int y;
- Shift()
- : x( 0 ), y( 0 )
- {}
- Shift( int x, int y )
- : x( x ), y( y )
- {}
- Shift operator+ ( const Shift & sh )
- {
- return Shift( x + sh.x, y + sh.y );
- }
- };
- std::vector<Shift> shift;
- };
- #endif //SCENE2D_H