mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 18:53:56 +00:00
Introduce a new image modification "~LOC(x,y,cx,cy)
allowing to create image as they are used by terrain system Name and syntax are WiP.
This commit is contained in:
parent
ce4177c06f
commit
a5055f75c8
@ -721,6 +721,16 @@ surface locator::load_image_sub_file() const
|
||||
ERR_DP << "no arguments passed to the ~CROP() function\n";
|
||||
}
|
||||
}
|
||||
else if("LOC" == function) {
|
||||
//FIXME: WIP, don't use it yet
|
||||
std::vector<std::string> const& params = utils::split(field);
|
||||
int x = lexical_cast<int>(params[0]);
|
||||
int y = lexical_cast<int>(params[1]);
|
||||
int cx = lexical_cast<int>(params[2]);
|
||||
int cy = lexical_cast<int>(params[3]);
|
||||
image::locator new_loc(val_.filename_, map_location(x,y), cx, cy, "");//TODO remove only ~LOC
|
||||
surf = get_image(new_loc, SCALED_TO_HEX);
|
||||
}
|
||||
// Scale (SCALE)
|
||||
else if("SCALE" == function) {
|
||||
std::vector<std::string> const& scale_params = utils::split(field, ',', utils::STRIP_SPACES);
|
||||
|
@ -104,6 +104,8 @@ namespace image {
|
||||
|
||||
const std::string &get_filename() const { return val_.filename_; }
|
||||
const map_location& get_loc() const { return val_.loc_ ; }
|
||||
int get_center_x() const { return val_.center_x_; }
|
||||
int get_center_y() const { return val_.center_y_; }
|
||||
const std::string& get_modifications() const {return val_.modifications_;}
|
||||
type get_type() const { return val_.type_; };
|
||||
// const int get_index() const { return index_; };
|
||||
|
Loading…
x
Reference in New Issue
Block a user