src/video/SDL_surface.c
changeset 1052 68f607298ca9
parent 1017 c2f2370ac1e5
child 1155 91569ec25acd
equal deleted inserted replaced
1051:091350827e08 1052:68f607298ca9
    89 		SDL_OutOfMemory();
    89 		SDL_OutOfMemory();
    90 		return(NULL);
    90 		return(NULL);
    91 	}
    91 	}
    92 	surface->flags = SDL_SWSURFACE;
    92 	surface->flags = SDL_SWSURFACE;
    93 	if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
    93 	if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
    94 		depth = screen->format->BitsPerPixel;
    94 		if ((Amask) && (video->displayformatalphapixel))
    95 		Rmask = screen->format->Rmask;
    95 		{
    96 		Gmask = screen->format->Gmask;
    96 			depth = video->displayformatalphapixel->BitsPerPixel;
    97 		Bmask = screen->format->Bmask;
    97 			Rmask = video->displayformatalphapixel->Rmask;
    98 		Amask = screen->format->Amask;
    98 			Gmask = video->displayformatalphapixel->Gmask;
       
    99 			Bmask = video->displayformatalphapixel->Bmask;
       
   100 			Amask = video->displayformatalphapixel->Amask;
       
   101 		}
       
   102 		else
       
   103 		{
       
   104 			depth = screen->format->BitsPerPixel;
       
   105 			Rmask = screen->format->Rmask;
       
   106 			Gmask = screen->format->Gmask;
       
   107 			Bmask = screen->format->Bmask;
       
   108 			Amask = screen->format->Amask;
       
   109 		}
    99 	}
   110 	}
   100 	surface->format = SDL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask);
   111 	surface->format = SDL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask);
   101 	if ( surface->format == NULL ) {
   112 	if ( surface->format == NULL ) {
   102 		free(surface);
   113 		free(surface);
   103 		return(NULL);
   114 		return(NULL);