Rename image::get_image_size() to image::get_size().

This commit is contained in:
Tommy 2022-06-05 15:20:23 +12:00
parent fbb967b225
commit da0bcd6dcb
10 changed files with 11 additions and 11 deletions

View File

@ -1520,7 +1520,7 @@ void display::render_image(int x, int y, const display::drawing_layer drawing_la
bool hreverse, bool greyscale, int32_t alpha,
color_t blendto, double blend_ratio, double submerged, bool vreverse)
{
const point image_size = image::get_image_size(i_locator);
const point image_size = image::get_size(i_locator);
if (!image_size.x || !image_size.y) {
return;
}

View File

@ -84,7 +84,7 @@ void terrain_layers::pre_show(window& window)
const int tz = game_config::tile_size;
SDL_Rect r {0,0,tz,tz};
const point img_size = image::get_image_size(img.get_filename());
const point img_size = image::get_size(img.get_filename());
// calculate which part of the image the terrain engine uses
if(loc_cut.valid()) {

View File

@ -44,7 +44,7 @@ image::image(const implementation::builder_image& builder)
point image::calculate_best_size() const
{
point image_size = ::image::get_image_size(::image::locator{get_label()});
point image_size = ::image::get_size(::image::locator{get_label()});
if(image_size.x == 0 || image_size.y == 0) {
DBG_GUI_L << LOG_HEADER << " empty image return default.\n";

View File

@ -909,7 +909,7 @@ surface get_hexmask()
return get_surface(terrain_mask, UNSCALED);
}
point get_image_size(const locator& i_locator)
point get_size(const locator& i_locator)
{
const surface s(get_surface(i_locator));
if (s != nullptr) {

View File

@ -295,7 +295,7 @@ surface get_hexmask();
* If the image is not yet in the surface cache, it will be loaded and cached.
*
*/
point get_image_size(const locator& i_locator);
point get_size(const locator& i_locator);
/**
* Checks if an image fits into a single hex.

View File

@ -46,7 +46,7 @@ static int intf_get_image_size(lua_State *L)
char const *m = luaL_checkstring(L, 1);
image::locator img(m);
if(!img.file_exists()) return 0;
const point s = get_image_size(img);
const point s = get_size(img);
lua_pushinteger(L, s.x);
lua_pushinteger(L, s.y);
return 2;

View File

@ -285,7 +285,7 @@ void unit_drawer::redraw_unit (const unit & u) const
int yoff;
if(cfg_offset_x.empty() && cfg_offset_y.empty()) {
const point s = scaled_to_zoom(
image::get_image_size(u.default_anim_image())
image::get_size(u.default_anim_image())
);
xoff = !s.x ? 0 : (hex_size - s.x)/2;
yoff = !s.y ? 0 : (hex_size - s.x)/2;

View File

@ -516,7 +516,7 @@ void unit_frame::redraw(const int frame_time, bool on_start_time, bool in_scope_
point image_size {0, 0};
if(!image_loc.is_void() && !image_loc.get_filename().empty()) { // invalid diag image, or not diagonal
image_size = image::get_image_size(image_loc);
image_size = image::get_size(image_loc);
}
const int d2 = display::get_singleton()->hex_size() / 2;
@ -679,7 +679,7 @@ std::set<map_location> unit_frame::get_overlaped_hex(const int frame_time, const
int w = 0, h = 0;
if(!image_loc.is_void() && !image_loc.get_filename().empty()) {
const point s = image::get_image_size(image_loc);
const point s = image::get_size(image_loc);
w = s.x;
h = s.y;
}

View File

@ -757,7 +757,7 @@ SDL_Rect menu::style::item_size(const std::string& item) const {
const std::string str = *it;
if (!str.empty() && str[0] == IMAGE_PREFIX) {
const std::string image_name(str.begin()+1,str.end());
const point image_size = image::get_image_size(image_name);
const point image_size = image::get_size(image_name);
if (image_size.x && image_size.y) {
int w = image_size.x;
int h = image_size.y;

View File

@ -55,7 +55,7 @@ scrollbar::scrollbar(CVideo &video)
, full_height_(0)
, scroll_rate_(1)
{
const point img_size(image::get_image_size(scrollbar_mid));
const point img_size(image::get_size(scrollbar_mid));
if (img_size.x && img_size.y) {
set_width(img_size.x);