mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 00:59:49 +00:00
Expose blur_alpha_surface() as the image-path function ~BL()
~BL() takes only one argument, which seems to be the radius of blur (blur_alpha_surface(), 2nd argument a.k.a. 'depth').
This commit is contained in:
parent
a0740f207b
commit
326332e89f
@ -355,6 +355,8 @@ surface locator::load_image_sub_file() const
|
||||
SDL_Rect slice_rect = { 0,0,0,0 };
|
||||
// ~CS() arguments
|
||||
int cs_r = 0, cs_g = 0, cs_b = 0;
|
||||
// ~BL() arguments
|
||||
unsigned blur = 0;
|
||||
|
||||
std::map<Uint32, Uint32> recolor_map;
|
||||
std::vector<std::string> modlist = utils::paranthetical_split(val_.modifications_,'~');
|
||||
@ -479,6 +481,9 @@ surface locator::load_image_sub_file() const
|
||||
slice_rect.h = lexical_cast_default<Uint16, const std::string&>(slice_params[3]);
|
||||
}
|
||||
}
|
||||
else if("BL" == function) { // Blur
|
||||
blur = std::max<int>(0, lexical_cast_default<int>(field));
|
||||
}
|
||||
// ~R(), ~G() and ~B() are the children of ~CS(). Merely syntatic sugar.
|
||||
// Hence they are at the end of the evaluation.
|
||||
else if("R" == function) {
|
||||
@ -526,6 +531,9 @@ surface locator::load_image_sub_file() const
|
||||
if(greyscale) {
|
||||
surf = greyscale_image(surf);
|
||||
}
|
||||
if(blur) {
|
||||
surf = blur_alpha_surface(surf, blur);
|
||||
}
|
||||
}
|
||||
return surf;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user