1 #ifndef _SDL_PAINTER_H
2 #define _SDL_PAINTER_H
3 
4 #define MAX_PAINT_ELTS 0x800
5 
6 #include "IosImgProcess.h"
7 
8 struct DrawElt {
9   IIM_Surface *surf;
10   SDL_Rect     rect;
11 };
12 
13 class SDL_Painter
14 {
15   public:
16       IIM_Surface *backGround;
17       IIM_Surface *gameScreen;
18 /*      SDL_Surface *display; */
19 
20       SDL_Painter(IIM_Surface *gameScreen = NULL, IIM_Surface *bg = NULL);
21       void requestDraw(IIM_Surface *surf, SDL_Rect *where);
22       void draw(SDL_Surface *surf);
23       void redrawAll(SDL_Surface *surf);
draw()24       void draw()      { draw(gameScreen->surf); }
redrawAll()25       void redrawAll() { redrawAll(gameScreen->surf); }
26 
27   private:
28 
29       int nbElts;
30       int nbPrev;
31       DrawElt onScreenElts[MAX_PAINT_ELTS];
32       DrawElt onScreenPrev[MAX_PAINT_ELTS];
33       void storeScreenContent(SDL_Surface *surf);
34 };
35 
36 #endif
37