From 84431bd782a1f0929216b506051c78c8af1d6185 Mon Sep 17 00:00:00 2001 From: FireForge <67974470+fire-forge@users.noreply.github.com> Date: Sat, 9 Jul 2022 15:43:34 -0500 Subject: Use integer types in Image and ImageTexture methods - Image.blit_rect() - Image.blit_rect_mask() - Image.blend_rect() - Image.blend_rect_mask() - Image.fill_rect() - Image.get_used_rect() - Image.get_rect() - ImageTexture.set_size_override() --- scene/resources/texture.cpp | 4 ++-- scene/resources/texture.h | 2 +- scene/resources/tile_set.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'scene/resources') diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 3a8f50c3c3..21ae62c92e 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -300,8 +300,8 @@ bool ImageTexture::is_pixel_opaque(int p_x, int p_y) const { return true; } -void ImageTexture::set_size_override(const Size2 &p_size) { - Size2 s = p_size; +void ImageTexture::set_size_override(const Size2i &p_size) { + Size2i s = p_size; if (s.x != 0) { w = s.x; } diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 5973643034..b107a2a70d 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -130,7 +130,7 @@ public: bool is_pixel_opaque(int p_x, int p_y) const override; - void set_size_override(const Size2 &p_size); + void set_size_override(const Size2i &p_size); virtual void set_path(const String &p_path, bool p_take_over = false) override; diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp index 139ffaf510..22b5ef0108 100644 --- a/scene/resources/tile_set.cpp +++ b/scene/resources/tile_set.cpp @@ -1801,9 +1801,9 @@ Vector>> TileSet::generate_terrains_icons(Size2i p_size) { if (counts[terrain_set][terrain].count > 0) { // Get the best tile. Ref texture = counts[terrain_set][terrain].texture; - Rect2 region = counts[terrain_set][terrain].region; + Rect2i region = counts[terrain_set][terrain].region; image->create(region.size.x, region.size.y, false, Image::FORMAT_RGBA8); - image->blit_rect(texture->get_image(), region, Point2()); + image->blit_rect(texture->get_image(), region, Point2i()); image->resize(p_size.x, p_size.y, Image::INTERPOLATE_NEAREST); } else { image->create(1, 1, false, Image::FORMAT_RGBA8); -- cgit v1.2.3