diff options
author | Yuri Sizov <yuris@humnom.net> | 2022-08-23 13:25:14 +0300 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2022-08-23 14:39:01 +0300 |
commit | 672e9d6868dd422f87fdbf69e6b7f0ecd84c4b64 (patch) | |
tree | e3bab7f256f0b7b798d2e337c2fbb38b076aeb19 /modules/svg | |
parent | d5606503b47a98a5d1d925b2b655760dab850e6e (diff) |
Make `ImageLoader` take bit field flags
Diffstat (limited to 'modules/svg')
-rw-r--r-- | modules/svg/image_loader_svg.cpp | 4 | ||||
-rw-r--r-- | modules/svg/image_loader_svg.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/svg/image_loader_svg.cpp b/modules/svg/image_loader_svg.cpp index 87e2fae2d0..4afeafc2dd 100644 --- a/modules/svg/image_loader_svg.cpp +++ b/modules/svg/image_loader_svg.cpp @@ -136,11 +136,11 @@ void ImageLoaderSVG::get_recognized_extensions(List<String> *p_extensions) const p_extensions->push_back("svg"); } -Error ImageLoaderSVG::load_image(Ref<Image> p_image, Ref<FileAccess> p_fileaccess, bool p_force_linear, float p_scale) { +Error ImageLoaderSVG::load_image(Ref<Image> p_image, Ref<FileAccess> p_fileaccess, uint32_t p_flags, float p_scale) { String svg = p_fileaccess->get_as_utf8_string(); create_image_from_string(p_image, svg, p_scale, false, false); ERR_FAIL_COND_V(p_image->is_empty(), FAILED); - if (p_force_linear) { + if (p_flags & FLAG_FORCE_LINEAR) { p_image->srgb_to_linear(); } return OK; diff --git a/modules/svg/image_loader_svg.h b/modules/svg/image_loader_svg.h index 94c17fda43..38b735aeac 100644 --- a/modules/svg/image_loader_svg.h +++ b/modules/svg/image_loader_svg.h @@ -42,7 +42,7 @@ public: void set_replace_colors(Dictionary p_replace_colors) { replace_colors = p_replace_colors; } void create_image_from_string(Ref<Image> p_image, String p_string, float p_scale, bool p_upsample, bool p_convert_color); - virtual Error load_image(Ref<Image> p_image, Ref<FileAccess> p_fileaccess, bool p_force_linear, float p_scale) override; + virtual Error load_image(Ref<Image> p_image, Ref<FileAccess> p_fileaccess, uint32_t p_flags, float p_scale) override; virtual void get_recognized_extensions(List<String> *p_extensions) const override; }; |