diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-12-30 14:45:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-30 14:45:41 +0100 |
commit | 534044e8f8921d90677f7bc307dd2997d6eb873e (patch) | |
tree | 535c1fe9023c432fe675df45a4f365e946807e33 /modules/tinyexr/image_loader_tinyexr.cpp | |
parent | 1d7b69ebbc02fa566e2e2a62b231b44a39f5a2c2 (diff) | |
parent | 08f71baca51a927dd20e4e10dd67e41cdeadd40d (diff) | |
download | redot-engine-534044e8f8921d90677f7bc307dd2997d6eb873e.tar.gz |
Merge pull request #24667 from akien-mga/fix-exr-alpha
Fix loading EXR with alpha channel
Diffstat (limited to 'modules/tinyexr/image_loader_tinyexr.cpp')
-rw-r--r-- | modules/tinyexr/image_loader_tinyexr.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/tinyexr/image_loader_tinyexr.cpp b/modules/tinyexr/image_loader_tinyexr.cpp index 63f0781028..81f61c1d4d 100644 --- a/modules/tinyexr/image_loader_tinyexr.cpp +++ b/modules/tinyexr/image_loader_tinyexr.cpp @@ -131,7 +131,7 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f Image::Format format; int output_channels = 0; - if (idxA > 0) { + if (idxA != -1) { imgdata.resize(exr_image.width * exr_image.height * 8); //RGBA16 format = Image::FORMAT_RGBAH; @@ -187,7 +187,7 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f const float *b_channel_start = reinterpret_cast<const float *>(tile.images[idxB]); const float *a_channel_start = NULL; - if (idxA > 0) { + if (idxA != -1) { a_channel_start = reinterpret_cast<const float *>(tile.images[idxA]); } @@ -216,7 +216,7 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, FileAccess *f, bool p_f *row_w++ = Math::make_half_float(color.g); *row_w++ = Math::make_half_float(color.b); - if (idxA > 0) { + if (idxA != -1) { *row_w++ = Math::make_half_float(*a_channel++); } } |