From: Tim Goya Date: Tue, 21 Aug 2007 00:28:52 +0000 (+0000) Subject: SDL: use SDL_DisplayFormat instead of SDL_DisplayFormatAlpha for images that don... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a62a9e28229f7e1def9a32fe9d88cad4debf55d1;p=supertux.git SDL: use SDL_DisplayFormat instead of SDL_DisplayFormatAlpha for images that don't use alpha or don't have an alpha channel, huge speedup SVN-Revision: 5148 --- diff --git a/src/video/sdl_texture.cpp b/src/video/sdl_texture.cpp index 2f1bc97dd..5b4b61f97 100644 --- a/src/video/sdl_texture.cpp +++ b/src/video/sdl_texture.cpp @@ -406,7 +406,14 @@ namespace SDL { Texture::Texture(SDL_Surface* image) { - texture = SDL_DisplayFormatAlpha(image); + if(!(image->flags & SDL_SRCALPHA) || !image->format->Amask) + { + texture = SDL_DisplayFormat(image); + } + else + { + texture = SDL_DisplayFormatAlpha(image); + } //width = texture->w; //height = texture->h; int numerator, denominator;