Mercurial > sdl-ios-xcode
comparison src/video/SDL_surface.c @ 1052:68f607298ca9
Some work on using accelerated alpha blits with hardware surfaces.
From Stephane Marchesin's fork, don't know who originally wrote it.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Sun, 17 Apr 2005 10:40:41 +0000 |
parents | c2f2370ac1e5 |
children | 91569ec25acd |
comparison
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); |