From 672e9d6868dd422f87fdbf69e6b7f0ecd84c4b64 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Tue, 23 Aug 2022 13:25:14 +0300 Subject: Make `ImageLoader` take bit field flags --- drivers/png/image_loader_png.cpp | 4 ++-- drivers/png/image_loader_png.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/png') diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp index 917bfec574..8d2f8a7ed6 100644 --- a/drivers/png/image_loader_png.cpp +++ b/drivers/png/image_loader_png.cpp @@ -36,7 +36,7 @@ #include -Error ImageLoaderPNG::load_image(Ref p_image, Ref f, bool p_force_linear, float p_scale) { +Error ImageLoaderPNG::load_image(Ref p_image, Ref f, uint32_t p_flags, float p_scale) { const uint64_t buffer_size = f->get_length(); Vector file_buffer; Error err = file_buffer.resize(buffer_size); @@ -48,7 +48,7 @@ Error ImageLoaderPNG::load_image(Ref p_image, Ref f, bool p_f f->get_buffer(writer, buffer_size); } const uint8_t *reader = file_buffer.ptr(); - return PNGDriverCommon::png_to_image(reader, buffer_size, p_force_linear, p_image); + return PNGDriverCommon::png_to_image(reader, buffer_size, p_flags & FLAG_FORCE_LINEAR, p_image); } void ImageLoaderPNG::get_recognized_extensions(List *p_extensions) const { diff --git a/drivers/png/image_loader_png.h b/drivers/png/image_loader_png.h index 9bcfb720d3..91c3c8925f 100644 --- a/drivers/png/image_loader_png.h +++ b/drivers/png/image_loader_png.h @@ -40,7 +40,7 @@ private: static Ref load_mem_png(const uint8_t *p_png, int p_size); public: - virtual Error load_image(Ref p_image, Ref f, bool p_force_linear, float p_scale); + virtual Error load_image(Ref p_image, Ref f, uint32_t p_flags, float p_scale); virtual void get_recognized_extensions(List *p_extensions) const; ImageLoaderPNG(); }; -- cgit v1.2.3