src/video/SDL_surface.c
changeset 1052 68f607298ca9
parent 1017 c2f2370ac1e5
child 1155 91569ec25acd
     1.1 --- a/src/video/SDL_surface.c	Sun Apr 17 10:36:03 2005 +0000
     1.2 +++ b/src/video/SDL_surface.c	Sun Apr 17 10:40:41 2005 +0000
     1.3 @@ -91,11 +91,22 @@
     1.4  	}
     1.5  	surface->flags = SDL_SWSURFACE;
     1.6  	if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
     1.7 -		depth = screen->format->BitsPerPixel;
     1.8 -		Rmask = screen->format->Rmask;
     1.9 -		Gmask = screen->format->Gmask;
    1.10 -		Bmask = screen->format->Bmask;
    1.11 -		Amask = screen->format->Amask;
    1.12 +		if ((Amask) && (video->displayformatalphapixel))
    1.13 +		{
    1.14 +			depth = video->displayformatalphapixel->BitsPerPixel;
    1.15 +			Rmask = video->displayformatalphapixel->Rmask;
    1.16 +			Gmask = video->displayformatalphapixel->Gmask;
    1.17 +			Bmask = video->displayformatalphapixel->Bmask;
    1.18 +			Amask = video->displayformatalphapixel->Amask;
    1.19 +		}
    1.20 +		else
    1.21 +		{
    1.22 +			depth = screen->format->BitsPerPixel;
    1.23 +			Rmask = screen->format->Rmask;
    1.24 +			Gmask = screen->format->Gmask;
    1.25 +			Bmask = screen->format->Bmask;
    1.26 +			Amask = screen->format->Amask;
    1.27 +		}
    1.28  	}
    1.29  	surface->format = SDL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask);
    1.30  	if ( surface->format == NULL ) {