Nasty bug fixed inside SDL_image - the colorkey was not set in SDL 1.2 because of SDL 1.3 changes

Also updated Biniax2
This commit is contained in:
pelya
2012-09-18 20:15:28 +03:00
parent f342ad315c
commit 72b5f3c86a
10 changed files with 37 additions and 11 deletions

View File

@@ -261,7 +261,11 @@ IMG_LoadGIF_RW(SDL_RWops *src)
#ifdef USED_BY_SDL
if ( Gif89.transparent >= 0 ) {
#if (SDL_VERSION_ATLEAST(1,3,0))
SDL_SetColorKey(image, SDL_TRUE, Gif89.transparent);
#else
SDL_SetColorKey(image, SDL_SRCCOLORKEY, Gif89.transparent);
#endif
}
#endif

View File

@@ -253,7 +253,12 @@ SDL_Surface *IMG_LoadLBM_RW( SDL_RWops *src )
goto done;
if ( bmhd.mask & 2 ) /* There is a transparent color */
#if (SDL_VERSION_ATLEAST(1,3,0))
SDL_SetColorKey( Image, SDL_TRUE, bmhd.tcolor );
#else
SDL_SetColorKey( Image, SDL_SRCCOLORKEY, bmhd.tcolor );
#endif
/* Update palette informations */

View File

@@ -481,7 +481,11 @@ SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src)
(Uint8)transv->red,
(Uint8)transv->green,
(Uint8)transv->blue);
#if (SDL_VERSION_ATLEAST(1,3,0))
SDL_SetColorKey(surface, SDL_TRUE, ckey);
#else
SDL_SetColorKey(surface, SDL_SRCCOLORKEY, ckey);
#endif
}
/* Create the array of pointers to image data */

View File

@@ -235,7 +235,11 @@ SDL_Surface *IMG_LoadTGA_RW(SDL_RWops *src)
}
free(pal);
if(ckey >= 0)
SDL_SetColorKey(img, SDL_TRUE, ckey);
#if (SDL_VERSION_ATLEAST(1,3,0))
SDL_SetColorKey(img, SDL_TRUE, ckey);
#else
SDL_SetColorKey(img, SDL_SRCCOLORKEY, ckey);
#endif
} else {
/* skip unneeded colormap */
SDL_RWseek(src, palsiz, RW_SEEK_CUR);

View File

@@ -431,7 +431,11 @@ static SDL_Surface *load_xpm(char **xpm, SDL_RWops *src)
add_colorhash(colors, nextkey, cpp, pixel);
nextkey += cpp;
if(rgb == 0xffffffff)
#if (SDL_VERSION_ATLEAST(1,3,0))
SDL_SetColorKey(image, SDL_TRUE, pixel);
#else
SDL_SetColorKey(image, SDL_SRCCOLORKEY, pixel);
#endif
break;
}
}