this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added an additional check for alpha channel in CopyImageFromSurface().

+11 -1
+11 -1
src/renderer_GL_common.inl
··· 145 145 return (SDL_GetColorKey(surface, NULL) == 0); 146 146 } 147 147 148 + static_inline GPU_bool is_alpha_format(SDL_PixelFormat* format) 149 + { 150 + return SDL_ISPIXELFORMAT_ALPHA(format->format); 151 + } 152 + 148 153 #else 149 154 150 155 #define SDL_Window SDL_Surface ··· 191 196 static_inline GPU_bool has_colorkey(SDL_Surface* surface) 192 197 { 193 198 return (surface->flags & SDL_SRCCOLORKEY); 199 + } 200 + 201 + static_inline GPU_bool is_alpha_format(SDL_PixelFormat* format) 202 + { 203 + return (format->BitsPerPixel == 32); // Not great, as it misses many packed formats. Might be the best we can do. 194 204 } 195 205 196 206 #endif ··· 3793 3803 // See what the best image format is. 3794 3804 if(surface->format->Amask == 0) 3795 3805 { 3796 - if(has_colorkey(surface)) 3806 + if(has_colorkey(surface) || is_alpha_format(surface->format)) 3797 3807 format = GPU_FORMAT_RGBA; 3798 3808 else 3799 3809 format = GPU_FORMAT_RGB;