Some work on using accelerated alpha blits with hardware surfaces.
From Stephane Marchesin's fork, don't know who originally wrote it. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401053
This commit is contained in:
parent
ec77fa9503
commit
8907a054cf
4 changed files with 32 additions and 5 deletions
|
@ -91,11 +91,22 @@ SDL_Surface * SDL_CreateRGBSurface (Uint32 flags,
|
|||
}
|
||||
surface->flags = SDL_SWSURFACE;
|
||||
if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) {
|
||||
depth = screen->format->BitsPerPixel;
|
||||
Rmask = screen->format->Rmask;
|
||||
Gmask = screen->format->Gmask;
|
||||
Bmask = screen->format->Bmask;
|
||||
Amask = screen->format->Amask;
|
||||
if ((Amask) && (video->displayformatalphapixel))
|
||||
{
|
||||
depth = video->displayformatalphapixel->BitsPerPixel;
|
||||
Rmask = video->displayformatalphapixel->Rmask;
|
||||
Gmask = video->displayformatalphapixel->Gmask;
|
||||
Bmask = video->displayformatalphapixel->Bmask;
|
||||
Amask = video->displayformatalphapixel->Amask;
|
||||
}
|
||||
else
|
||||
{
|
||||
depth = screen->format->BitsPerPixel;
|
||||
Rmask = screen->format->Rmask;
|
||||
Gmask = screen->format->Gmask;
|
||||
Bmask = screen->format->Bmask;
|
||||
Amask = screen->format->Amask;
|
||||
}
|
||||
}
|
||||
surface->format = SDL_AllocFormat(depth, Rmask, Gmask, Bmask, Amask);
|
||||
if ( surface->format == NULL ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue