mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-08 02:46:26 +00:00
use SDL_InvalidParamError or SDL_assert instead of custom SDL_SetError
This commit is contained in:
@@ -219,7 +219,7 @@ int
|
||||
SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette)
|
||||
{
|
||||
if (!surface) {
|
||||
return SDL_SetError("SDL_SetSurfacePalette() passed a NULL surface");
|
||||
return SDL_InvalidParamError("SDL_SetSurfacePalette(): surface");
|
||||
}
|
||||
if (SDL_SetPixelFormatPalette(surface->format, palette) < 0) {
|
||||
return -1;
|
||||
@@ -646,7 +646,7 @@ SDL_UpperBlit(SDL_Surface * src, const SDL_Rect * srcrect,
|
||||
|
||||
/* Make sure the surfaces aren't locked */
|
||||
if (!src || !dst) {
|
||||
return SDL_SetError("SDL_UpperBlit: passed a NULL surface");
|
||||
return SDL_InvalidParamError("SDL_UpperBlit(): src/dst");
|
||||
}
|
||||
if (src->locked || dst->locked) {
|
||||
return SDL_SetError("Surfaces must not be locked during blit");
|
||||
@@ -757,7 +757,7 @@ SDL_PrivateUpperBlitScaled(SDL_Surface * src, const SDL_Rect * srcrect,
|
||||
|
||||
/* Make sure the surfaces aren't locked */
|
||||
if (!src || !dst) {
|
||||
return SDL_SetError("SDL_UpperBlitScaled: passed a NULL surface");
|
||||
return SDL_InvalidParamError("SDL_UpperBlitScaled(): src/dst");
|
||||
}
|
||||
if (src->locked || dst->locked) {
|
||||
return SDL_SetError("Surfaces must not be locked during blit");
|
||||
|
Reference in New Issue
Block a user