Debian Codegraph @

src/effect/LayeredPicture.h

raw
1 #ifndef HEADER_LAYEREDPICTURE_H
2 #define HEADER_LAYEREDPICTURE_H
3
4 #include "Picture.h"
5
6 #include "SDL.h"
7
8 /**
9 * Picture with two layers and color mask.
10 */
11 class LayeredPicture : public Picture {
12 private:
13 static const Uint32 MASK_NO = static_cast<Uint32>(-1);
14 SDL_Surface *m_lowerLayer;
15 SDL_Surface *m_colorMask;
16 Uint32 m_activeColor;
17 public:
18 LayeredPicture(const Path &bg_file, const V2 &loc,
19 const Path &lowerLayer, const Path &colorMask);
20 ~LayeredPicture();
21
22 void setNoActive() { m_activeColor = MASK_NO; }
23 void setActiveMask(Uint32 color) { m_activeColor = color; }
24
25 Uint32 getMaskAtWorld(const V2 &worldLoc);
26 Uint32 getMaskAt(const V2 &loc);
27 Uint32 getNoMask() const { return MASK_NO; }
28
29 virtual void drawOn(SDL_Surface *screen);
30 };
31
32 #endif