Fix: Targa with Palette Shows Grayscale in Viewport. #106047

Merged
Jeroen Bakker merged 3 commits from Jeroen-Bakker/blender:image-target-draws-grayscale into main 2023-03-24 07:46:44 +01:00
1 changed files with 1 additions and 6 deletions

View File

@ -676,12 +676,7 @@ ImBuf *imb_loadtarga(const uchar *mem, size_t mem_size, int flags, char colorspa
cmap[count] = cp_data;
}
size = 0;
for (int cmap_index = cmap_max - 1; cmap_index > 0; cmap_index >>= 1) {
size++;
}
ibuf->planes = size;
ibuf->planes = tga.mapbits;

Not sure the comment is that useful. It is not the only place where the assignment to the planes happens, and the GPU sides optimizations might change in the future.

To me the ibuf->places = tga.mapbits seems clear by itself.

Not sure the comment is that useful. It is not the only place where the assignment to the planes happens, and the GPU sides optimizations might change in the future. To me the `ibuf->places = tga.mapbits` seems clear by itself.
if (tga.mapbits != 32) { /* Set alpha bits. */
cmap[0] &= BIG_LONG(0x00ffffffl);
}