mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-11 05:48:13 +00:00
Fixed bug 4264 - SDL_CreateTextureFromSurface generates error message but returns ok
Anthony @ POW Games SDL_CreateTextureFromSurface makes an internal call to SDL_GetColorKey which can return an error and spams the error log with "Surface doesn't have a colorkey" even though the original function didn't return an error.
This commit is contained in:
@@ -649,7 +649,7 @@ SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface)
|
||||
|
||||
/* See what the best texture format is */
|
||||
fmt = surface->format;
|
||||
if (fmt->Amask || SDL_GetColorKey(surface, NULL) == 0) {
|
||||
if (fmt->Amask || (SDL_HasColorKey(surface) && SDL_GetColorKey(surface, NULL) == 0)) {
|
||||
needAlpha = SDL_TRUE;
|
||||
} else {
|
||||
needAlpha = SDL_FALSE;
|
||||
|
Reference in New Issue
Block a user