Fixed bug 2840 - Wrong colors in TGA files from GTA2
authorSam Lantinga <slouken@libsdl.org>
Mon, 11 Sep 2017 23:42:09 -0700
changeset 50164a10bd1598c
parent 500 28967769bc2e
child 502 7f374d902c16
Fixed bug 2840 - Wrong colors in TGA files from GTA2

Amit Jain

Swapping of bits happened for SDL_LIL_ENDIAN system which is wrong. It should be for SDL_BIG_ENDIAN system.
IMG_tga.c
     1.1 --- a/IMG_tga.c	Mon Sep 11 21:23:09 2017 -0700
     1.2 +++ b/IMG_tga.c	Mon Sep 11 23:42:09 2017 -0700
     1.3 @@ -301,7 +301,7 @@
     1.4          } else {
     1.5              SDL_RWread(src, dst, w * bpp, 1);
     1.6          }
     1.7 -#if SDL_BYTEORDER == SDL_LIL_ENDIAN
     1.8 +#if SDL_BYTEORDER == SDL_BIG_ENDIAN
     1.9          if (bpp == 2) {
    1.10              /* swap byte order */
    1.11              int x;