diff options
Diffstat (limited to 'drivers/png/resource_saver_png.cpp')
-rw-r--r-- | drivers/png/resource_saver_png.cpp | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/png/resource_saver_png.cpp b/drivers/png/resource_saver_png.cpp index 2380c2685f..3a0b319a45 100644 --- a/drivers/png/resource_saver_png.cpp +++ b/drivers/png/resource_saver_png.cpp @@ -36,7 +36,6 @@ #include "scene/resources/texture.h" Error ResourceSaverPNG::save(const String &p_path, const RES &p_resource, uint32_t p_flags) { - Ref<ImageTexture> texture = p_resource; ERR_FAIL_COND_V_MSG(!texture.is_valid(), ERR_INVALID_PARAMETER, "Can't save invalid texture as PNG."); @@ -50,7 +49,6 @@ Error ResourceSaverPNG::save(const String &p_path, const RES &p_resource, uint32 }; Error ResourceSaverPNG::save_image(const String &p_path, const Ref<Image> &p_img) { - Vector<uint8_t> buffer; Error err = PNGDriverCommon::image_to_png(p_img, buffer); ERR_FAIL_COND_V_MSG(err, err, "Can't convert image to PNG."); @@ -72,7 +70,6 @@ Error ResourceSaverPNG::save_image(const String &p_path, const Ref<Image> &p_img } Vector<uint8_t> ResourceSaverPNG::save_image_to_buffer(const Ref<Image> &p_img) { - Vector<uint8_t> buffer; Error err = PNGDriverCommon::image_to_png(p_img, buffer); ERR_FAIL_COND_V_MSG(err, Vector<uint8_t>(), "Can't convert image to PNG."); @@ -80,19 +77,16 @@ Vector<uint8_t> ResourceSaverPNG::save_image_to_buffer(const Ref<Image> &p_img) } bool ResourceSaverPNG::recognize(const RES &p_resource) const { - return (p_resource.is_valid() && p_resource->is_class("ImageTexture")); } void ResourceSaverPNG::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const { - if (Object::cast_to<ImageTexture>(*p_resource)) { p_extensions->push_back("png"); } } ResourceSaverPNG::ResourceSaverPNG() { - Image::save_png_func = &save_image; Image::save_png_buffer_func = &save_image_to_buffer; }; |