Skip to content

Commit

Permalink
More efficient 8-bit copy of PCX image
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jun 10, 2019
1 parent ee60e60 commit 2b906c8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions IMG_pcx.c
Expand Up @@ -215,13 +215,8 @@ SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src)
}
}
} else if ( src_bits == 8 ) {
/* directly copy buf content to row */
Uint8 *innerSrc = buf;
int x;
Uint8 *dst = row;
for ( x = 0; x < width; x++ ) {
*dst++ = *innerSrc++;
}
/* Copy the row directly */
SDL_memcpy(row, buf, SDL_min(width, bpl));
} else if ( src_bits == 24 ) {
/* de-interlace planes */
Uint8 *innerSrc = buf;
Expand Down

0 comments on commit 2b906c8

Please sign in to comment.