Skip to content

Commit

Permalink
Merge pull request #80862 from BlueCube3310/dds-grayscale-load-fix
Browse files Browse the repository at this point in the history
Make DDS loading code only check for R channel bitmask when loading grayscale images
  • Loading branch information
akien-mga committed Aug 28, 2023
2 parents 0655a7d + 1d51c55 commit 359bb38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/dds/image_loader_dds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ Error ImageLoaderDDS::load_image(Ref<Image> p_image, Ref<FileAccess> f, BitField
dds_format = DDS_BGR10A2;
} else if (format_flags & DDPF_RGB && !(format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 16 && format_red_mask == 0x0000f800 && format_green_mask == 0x000007e0 && format_blue_mask == 0x0000001f) {
dds_format = DDS_BGR565;
} else if (!(format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 8 && format_red_mask == 0xff && format_green_mask == 0xff && format_blue_mask == 0xff) {
} else if (!(format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 8 && format_red_mask == 0xff) {
dds_format = DDS_LUMINANCE;
} else if ((format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 16 && format_red_mask == 0xff && format_green_mask == 0xff && format_blue_mask == 0xff && format_alpha_mask == 0xff00) {
} else if ((format_flags & DDPF_ALPHAPIXELS) && format_rgb_bits == 16 && format_red_mask == 0xff && format_alpha_mask == 0xff00) {
dds_format = DDS_LUMINANCE_ALPHA;
} else if (format_flags & DDPF_INDEXED && format_rgb_bits == 8) {
dds_format = DDS_BGR565;
Expand Down

0 comments on commit 359bb38

Please sign in to comment.