20 #include "win_theme.h" 21 #include "win_background.h" 23 win_background::win_background()
29 set_visible_background(
false);
31 set_brightness_background(
false);
33 set_trans_background(
true);
37 win_background::win_background(
win_base * wb)
43 set_visible_background(
false);
45 set_brightness_background(
false);
47 set_trans_background(
true);
51 win_background::win_background(
char *rep)
57 set_visible_background(
false);
59 set_brightness_background(
false);
61 set_trans_background(
true);
63 win_background::load(rep);
75 set_visible_background(
false);
77 set_brightness_background(
false);
79 set_trans_background(
true);
87 win_background::~win_background()
93 void win_background::destroy()
95 if(background_template_)
delete background_template_;
96 if(background_)
delete background_;
97 if(background_brightness_)
delete background_brightness_;
102 void win_background::init()
104 background_template_=NULL;
106 background_brightness_=NULL;
107 background_draw_=NULL;
114 background_template_=
new image();
115 *background_template_=*(wb.background_template_);
116 background_=
new image();
118 background_brightness_=
new image();
119 background_brightness_->
set_mask(
true);
134 void win_background::set_background(
win_theme & wt)
136 *
this=*(wt.background);
140 void win_background::set_brightness_background(
bool b)
146 void win_background::refresh()
148 background_draw_=(brightness_)? background_brightness_ : background_ ;
151 void win_background::load(
char *rep)
155 strcpy(
path,WIN_DIRECTORY);
156 strcat(
path,WIN_BACKGROUND_DIRECTORY);
158 strcat(
path,WIN_BACKGROUND_FILE);
159 background_template_=
new image();
162 background_=
new image();
165 background_brightness_=
new image();
166 background_brightness_->
set_mask(
true);
170 void win_background::update()
172 if(!background_template_) return ;
175 background_->
tile(*background_template_);
176 background_brightness_->
brightness(*background_,WIN_BRIGHTNESS_LEVEL);
182 if(!visible_ || !background_draw_ || !wb_)
return;
187 void win_background::set_trans_background(
bool b)
189 if(!background_template_)
return;
void resize(u_int16 l, u_int16 h)
Resize this image.
u_int16 length() const
Returns the length of the drawing_area.
Image manipulation class.
s_int16 real_y() const
Return the vertical position of the win_*.
void tile(const surface &src)
Tiles a surface.
Implements "drawing zones" for drawing operations.
void set_alpha(u_int8 a, const bool &alpha_channel=false)
Sets the alpha value of the surface.
A* pathfinding algorithm implementation class.
s_int16 real_x() const
Return the horizontal position of the win_*.
void brightness(const surface &src, u_int8 cont, bool proceed_mask=false)
Applies a "brightness" to a surface.
s_int8 load_pnm(string fname)
Loads an image from a file name, in PNM format, without alpha and mask values.
Common properties for each win_base's object.
u_int16 height() const
Returns the height of the drawing_area.
void set_mask(bool m)
Sets the mask parameter of the surface.
void draw(s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
Draw the surface.