mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-08 10:56:27 +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:
@@ -292,6 +292,20 @@ SDL_SetColorKey(SDL_Surface * surface, int flag, Uint32 key)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasColorKey(SDL_Surface * surface)
|
||||
{
|
||||
if (!surface) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
if (!(surface->map->info.flags & SDL_COPY_COLORKEY)) {
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_GetColorKey(SDL_Surface * surface, Uint32 * key)
|
||||
{
|
||||
|
Reference in New Issue
Block a user