16 #define GETTEXT_DOMAIN "wesnoth-lib" 30 0x000000, 0x000000, 0x333333,
38 normal_rgb_(0x000000), selected_rgb_(0x000099), heading_rgb_(0x333333),
39 normal_alpha_(0.2), selected_alpha_(0.6), heading_alpha_(0.3),
40 max_img_w_(-1), max_img_h_(-1)
46 int normal_rgb,
int selected_rgb,
int heading_rgb,
47 double normal_alpha,
double selected_alpha,
double heading_alpha)
48 : img_base_(img_base), has_background_(has_bg), initialized_(false), load_failed_(false),
49 normal_rgb2_(normal_rgb), selected_rgb2_(selected_rgb), heading_rgb2_(heading_rgb),
50 normal_alpha2_(normal_alpha), selected_alpha2_(selected_alpha), heading_alpha2_(heading_alpha)
79 return scale_surface(surf, (scale * surf->w)/100, (scale * surf->h)/100);
90 return image.
get() !=
nullptr;
150 SDL_Rect clip = rect;
168 SDL_Rect clip = rect;
178 }
while( area.x < rect.x + rect.w );
186 }
while( area.y < rect.y + rect.h );
194 }
while( area.y < rect.y + rect.h );
202 }
while( area.x < rect.x + rect.w );
209 image =
img_map_[
"border-topright"];
210 area.x = rect.x + rect.w - image->w;
216 area.y = rect.y + rect.h - image->h;
219 image =
img_map_[
"border-botright"];
220 area.x = rect.x + rect.w - image->w;
221 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)
Draws a surface directly onto the screen framebuffer.
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.