diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-05-17 07:36:47 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-05-17 07:37:45 -0300 |
commit | 98a329670227c726a5d7a196e5cba8dbdd54301b (patch) | |
tree | 7346f7a3e38eb35b784ac1a68a227d07cc8881b4 /scene/resources/default_theme/default_theme.cpp | |
parent | d801ff2b3db2de105c1b36a74ce116e360143d4e (diff) |
Removal of Image from Variant, converted to a Resource.
Diffstat (limited to 'scene/resources/default_theme/default_theme.cpp')
-rw-r--r-- | scene/resources/default_theme/default_theme.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 7d134a2c20..ac3b46c69f 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -53,20 +53,20 @@ static Ref<StyleBoxTexture> make_stylebox(T p_src, float p_left, float p_top, fl } else { texture = Ref<ImageTexture>(memnew(ImageTexture)); - Image img(p_src); + Ref<Image> img = memnew(Image(p_src)); if (scale > 1) { - Size2 orig_size = Size2(img.get_width(), img.get_height()); + Size2 orig_size = Size2(img->get_width(), img->get_height()); - img.convert(Image::FORMAT_RGBA8); - img.expand_x2_hq2x(); + img->convert(Image::FORMAT_RGBA8); + img->expand_x2_hq2x(); if (scale != 2.0) { - img.resize(orig_size.x * scale, orig_size.y * scale); + img->resize(orig_size.x * scale, orig_size.y * scale); } } else if (scale < 1) { - Size2 orig_size = Size2(img.get_width(), img.get_height()); - img.convert(Image::FORMAT_RGBA8); - img.resize(orig_size.x * scale, orig_size.y * scale); + Size2 orig_size = Size2(img->get_width(), img->get_height()); + img->convert(Image::FORMAT_RGBA8); + img->resize(orig_size.x * scale, orig_size.y * scale); } texture->create_from_image(img, ImageTexture::FLAG_FILTER); @@ -105,19 +105,19 @@ template <class T> static Ref<Texture> make_icon(T p_src) { Ref<ImageTexture> texture(memnew(ImageTexture)); - Image img = Image(p_src); + Ref<Image> img = memnew(Image(p_src)); if (scale > 1) { - Size2 orig_size = Size2(img.get_width(), img.get_height()); + Size2 orig_size = Size2(img->get_width(), img->get_height()); - img.convert(Image::FORMAT_RGBA8); - img.expand_x2_hq2x(); + img->convert(Image::FORMAT_RGBA8); + img->expand_x2_hq2x(); if (scale != 2.0) { - img.resize(orig_size.x * scale, orig_size.y * scale); + img->resize(orig_size.x * scale, orig_size.y * scale); } } else if (scale < 1) { - Size2 orig_size = Size2(img.get_width(), img.get_height()); - img.convert(Image::FORMAT_RGBA8); - img.resize(orig_size.x * scale, orig_size.y * scale); + Size2 orig_size = Size2(img->get_width(), img->get_height()); + img->convert(Image::FORMAT_RGBA8); + img->resize(orig_size.x * scale, orig_size.y * scale); } texture->create_from_image(img, ImageTexture::FLAG_FILTER); @@ -162,7 +162,7 @@ static Ref<BitmapFont> make_font2(int p_height, int p_ascent, int p_charcount, c Ref<BitmapFont> font(memnew(BitmapFont)); - Image image(p_img); + Ref<Image> image = memnew(Image(p_img)); Ref<ImageTexture> tex = memnew(ImageTexture); tex->create_from_image(image); |