Skip to content
Myr

comment was wrong way around... code was right.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Jean-S�bastien Guay · committed by Jean-S�bastien Guay · parent b8b364c · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:stb_image_write.h+1 added-1 removed
179 unmodified lines
180int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)181{182 int has_alpha = !(comp & 1);183 int colorbytes = comp - has_alpha;184 int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 3, 1 color channel (Y/YA) = 2184 int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3185 if (format == 2) colorbytes = 3; // is 2 color channels (RG/RGA) even possible? write as RGB/RGBA186 return outfile(filename, -1,-1, x, y, comp, (void *) data, has_alpha, 0,187 "111 221 2222 11", 0,0,format, 0,0,0, 0,0,x,y, (colorbytes+has_alpha)*8, has_alpha*8);188}
333 unmodified lines