Skip to content

Commit

Permalink
Optimize tga_decode_raw() a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
skullernet committed Jul 26, 2024
1 parent 9109a5a commit 2b76657
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/refresh/images.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,12 +412,12 @@ static int tga_decode_raw(sizebuf_t *s, uint32_t **row_pointers,

for (row = 0; row < rows; row++) {
out_row = row_pointers[row];
for (col = 0; col < cols; col++) {
if (palette)
if (palette) {
for (col = 0; col < cols; col++, in++)
*out_row++ = palette[*in];
else
} else {
for (col = 0; col < cols; col++, in += bpp)
*out_row++ = tga_unpack_pixel(in, bpp);
in += bpp;
}
}

Expand Down

0 comments on commit 2b76657

Please sign in to comment.