17 #define GETTEXT_DOMAIN "wesnoth-lib" 31 0x000000, 0x000000, 0x333333,
39 normal_rgb_(0x000000), selected_rgb_(0x000099), heading_rgb_(0x333333),
40 normal_alpha_(0.2), selected_alpha_(0.6), heading_alpha_(0.3),
41 max_img_w_(-1), max_img_h_(-1)
47 int normal_rgb,
int selected_rgb,
int heading_rgb,
48 double normal_alpha,
double selected_alpha,
double heading_alpha)
49 : img_base_(img_base), has_background_(has_bg), initialized_(false), load_failed_(false),
50 normal_rgb2_(normal_rgb), selected_rgb2_(selected_rgb), heading_rgb2_(heading_rgb),
51 normal_alpha2_(normal_alpha), selected_alpha2_(selected_alpha), heading_alpha2_(heading_alpha)
80 return scale_surface(surf, (scale * surf->w)/100, (scale * surf->h)/100);
91 return image.
get() !=
nullptr;
151 SDL_Rect clip = rect;
169 SDL_Rect clip = rect;
179 }
while( area.x < rect.x + rect.w );
187 }
while( area.y < rect.y + rect.h );
195 }
while( area.y < rect.y + rect.h );
203 }
while( area.x < rect.x + rect.w );
210 image =
img_map_[
"border-topright"];
211 area.x = rect.x + rect.w - image->w;
217 area.y = rect.y + rect.h - image->h;
220 image =
img_map_[
"border-botright"];
221 area.x = rect.x + rect.w - image->w;
222 area.y = rect.y + rect.h - image->h;
surface get_image(const image::locator &i_locator, TYPE type)
Caches and returns an image.
SDL_Surface * get() const
Collection of helper functions relating to Pango formatting.
New lexcical_cast header.
surface scale_surface(const surface &surf, int w, int h)
Scale a surface using alpha-weighted modified bilinear filtering Note: causes artifacts with alpha gr...
void blit_surface(int x, int y, surface surf, SDL_Rect *srcrect=nullptr, SDL_Rect *clip_rect=nullptr)
Copies an area of a surface to the drawing surface.
void scale(size_t factor, const uint32_t *src, uint32_t *trg, int srcWidth, int srcHeight, const ScalerCfg &cfg=ScalerCfg(), int yFirst=0, int yLast=std::numeric_limits< int >::max())
Generic locator abstracting the location of an image.
Functions to load and save images from/to disk.