use SDL_InvalidParamError or SDL_assert instead of custom SDL_SetError

This commit is contained in:
pionere
2022-01-17 16:26:02 +01:00
committed by Ryan C. Gordon
parent 4a17612bff
commit ebdd536676
36 changed files with 109 additions and 123 deletions

View File

@@ -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");