Fixed bug 3992 - SDL_GetColorKey doesn't set error message
Luke A. Guest SDL_GetColorKey does not set an error message on failure. The current source just returns -1. The documentation https://wiki.libsdl.org/SDL_GetColorKey?highlight=%28%5CbCategoryAPI%5Cb%29%7C%28SDLFunctionTemplate%29 says to call SDL_GetError but that is useless in this case.
This commit is contained in:
parent
35623271c9
commit
44e7397995
1 changed files with 2 additions and 2 deletions
|
@ -296,11 +296,11 @@ int
|
||||||
SDL_GetColorKey(SDL_Surface * surface, Uint32 * key)
|
SDL_GetColorKey(SDL_Surface * surface, Uint32 * key)
|
||||||
{
|
{
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
return -1;
|
return SDL_InvalidParamError("surface");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(surface->map->info.flags & SDL_COPY_COLORKEY)) {
|
if (!(surface->map->info.flags & SDL_COPY_COLORKEY)) {
|
||||||
return -1;
|
return SDL_SetError("Surface doesn't have a colorkey");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue