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 1 deletions
Showing only changes of commit df6dde1834 - Show all commits

View File

@ -679,7 +679,7 @@ ImBuf *imb_loadtarga(const uchar *mem, size_t mem_size, int flags, char colorspa
/* Set the planes based on the number of planes of the palette. Planes are

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.
* used to optimize the storage on the GPU. When planes are not set correctly the image can
* draw as if it was a grayscale image. */
ibuf->planes = (tga.mapbits >> 3) * 8;
ibuf->planes = tga.mapbits;
if (tga.mapbits != 32) { /* Set alpha bits. */
cmap[0] &= BIG_LONG(0x00ffffffl);