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/hdr | |
parent | d5606503b47a98a5d1d925b2b655760dab850e6e (diff) |
Make `ImageLoader` take bit field flags
Diffstat (limited to 'modules/hdr')
-rw-r--r-- | modules/hdr/image_loader_hdr.cpp | 4 | ||||
-rw-r--r-- | modules/hdr/image_loader_hdr.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/hdr/image_loader_hdr.cpp b/modules/hdr/image_loader_hdr.cpp index eca689e87a..e7c6fe592d 100644 --- a/modules/hdr/image_loader_hdr.cpp +++ b/modules/hdr/image_loader_hdr.cpp @@ -33,7 +33,7 @@ #include "core/os/os.h" #include "core/string/print_string.h" -Error ImageLoaderHDR::load_image(Ref<Image> p_image, Ref<FileAccess> f, bool p_force_linear, float p_scale) { +Error ImageLoaderHDR::load_image(Ref<Image> p_image, Ref<FileAccess> f, uint32_t p_flags, float p_scale) { String header = f->get_token(); ERR_FAIL_COND_V_MSG(header != "#?RADIANCE" && header != "#?RGBE", ERR_FILE_UNRECOGNIZED, "Unsupported header information in HDR: " + header + "."); @@ -131,7 +131,7 @@ Error ImageLoaderHDR::load_image(Ref<Image> p_image, Ref<FileAccess> f, bool p_f ptr[1] * exp / 255.0, ptr[2] * exp / 255.0); - if (p_force_linear) { + if (p_flags & FLAG_FORCE_LINEAR) { c = c.srgb_to_linear(); } diff --git a/modules/hdr/image_loader_hdr.h b/modules/hdr/image_loader_hdr.h index 16c0816562..1bff05129b 100644 --- a/modules/hdr/image_loader_hdr.h +++ b/modules/hdr/image_loader_hdr.h @@ -35,7 +35,7 @@ class ImageLoaderHDR : public ImageFormatLoader { public: - virtual Error load_image(Ref<Image> p_image, Ref<FileAccess> f, bool p_force_linear, float p_scale); + virtual Error load_image(Ref<Image> p_image, Ref<FileAccess> f, uint32_t p_flags, float p_scale); virtual void get_recognized_extensions(List<String> *p_extensions) const; ImageLoaderHDR(); }; |