| 1183 | } |
| 1184 | |
| 1185 | SDL_Surface * |
| 1186 | SDL_ConvertSurfaceFormat(SDL_Surface * surface, Uint32 pixel_format, |
| 1187 | Uint32 flags) |
| 1188 | { |
| 1189 | SDL_PixelFormat *fmt; |
| 1190 | SDL_Surface *convert = NULL; |
| 1191 | |
| 1192 | fmt = SDL_AllocFormat(pixel_format); |
| 1193 | if (fmt) { |
| 1194 | convert = SDL_ConvertSurface(surface, fmt, flags); |
| 1195 | SDL_FreeFormat(fmt); |
| 1196 | } |
| 1197 | return convert; |
| 1198 | } |
| 1199 | |
| 1200 | /* |
| 1201 | * Create a surface on the stack for quick blit operations |