comparison src/video/SDL_video.c @ 4987:b68a0e03db02

Set blend mode for textures that were created from surfaces with a colorkey
author Sam Lantinga <slouken@libsdl.org>
date Wed, 12 Jan 2011 15:58:53 -0800
parents 889e6fef8fc5
children 1cee937d9fcc
comparison
equal deleted inserted replaced
4986:8431f59485d0 4987:b68a0e03db02
1986 SDL_SetTextureColorMod(texture, r, g, b); 1986 SDL_SetTextureColorMod(texture, r, g, b);
1987 1987
1988 SDL_GetSurfaceAlphaMod(surface, &a); 1988 SDL_GetSurfaceAlphaMod(surface, &a);
1989 SDL_SetTextureAlphaMod(texture, a); 1989 SDL_SetTextureAlphaMod(texture, a);
1990 1990
1991 SDL_GetSurfaceBlendMode(surface, &blendMode); 1991 if (surface->map->info.flags & SDL_COPY_COLORKEY) {
1992 SDL_SetTextureBlendMode(texture, blendMode); 1992 /* We converted to a texture with alpha format */
1993 SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND);
1994 } else {
1995 SDL_GetSurfaceBlendMode(surface, &blendMode);
1996 SDL_SetTextureBlendMode(texture, blendMode);
1997 }
1993 1998
1994 SDL_GetSurfaceScaleMode(surface, &scaleMode); 1999 SDL_GetSurfaceScaleMode(surface, &scaleMode);
1995 SDL_SetTextureScaleMode(texture, scaleMode); 2000 SDL_SetTextureScaleMode(texture, scaleMode);
1996 } 2001 }
1997 2002