diff options
Diffstat (limited to 'scene/resources/texture.cpp')
-rw-r--r-- | scene/resources/texture.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 3a2b0ed9cb..5232e8fcab 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -60,20 +60,14 @@ Size2 Texture2D::get_size() const { } bool Texture2D::is_pixel_opaque(int p_x, int p_y) const { - bool ret; - if (GDVIRTUAL_CALL(_is_pixel_opaque, p_x, p_y, ret)) { - return ret; - } - - return true; + bool ret = true; + GDVIRTUAL_CALL(_is_pixel_opaque, p_x, p_y, ret); + return ret; } bool Texture2D::has_alpha() const { - bool ret; - if (GDVIRTUAL_CALL(_has_alpha, ret)) { - return ret; - } - - return true; + bool ret = true; + GDVIRTUAL_CALL(_has_alpha, ret); + return ret; } void Texture2D::draw(RID p_canvas_item, const Point2 &p_pos, const Color &p_modulate, bool p_transpose) const { @@ -122,7 +116,7 @@ void Texture2D::_bind_methods() { GDVIRTUAL_BIND(_draw, "to_canvas_item", "pos", "modulate", "transpose") GDVIRTUAL_BIND(_draw_rect, "to_canvas_item", "rect", "tile", "modulate", "transpose") - GDVIRTUAL_BIND(_draw_rect_region, "tp_canvas_item", "rect", "src_rect", "modulate", "transpose", "clip_uv"); + GDVIRTUAL_BIND(_draw_rect_region, "to_canvas_item", "rect", "src_rect", "modulate", "transpose", "clip_uv"); } Texture2D::Texture2D() { @@ -653,7 +647,7 @@ Ref<Image> CompressedTexture2D::load_image_from_file(Ref<FileAccess> f, int p_si Image::Format format = Image::Format(f->get_32()); if (data_format == DATA_FORMAT_PNG || data_format == DATA_FORMAT_WEBP || data_format == DATA_FORMAT_BASIS_UNIVERSAL) { - //look for a PNG or WEBP file inside + //look for a PNG or WebP file inside int sw = w; int sh = h; |