[client,sdl] ignore blit that does not intersect

SdlWindow::blit might be called for areas that do not intersect the
surface. Return success in such cases to avoid terminating a session.
This commit is contained in:
akallabeth 2024-03-11 12:18:49 +01:00 committed by akallabeth
parent fd46a43934
commit 1f22a4f954

View File

@ -186,9 +186,9 @@ bool SdlWindow::blit(SDL_Surface* surface, const SDL_Rect& srcRect, SDL_Rect& ds
if (!screen || !surface) if (!screen || !surface)
return false; return false;
if (!SDL_SetClipRect(surface, &srcRect)) if (!SDL_SetClipRect(surface, &srcRect))
return false; return true;
if (!SDL_SetClipRect(screen, &dstRect)) if (!SDL_SetClipRect(screen, &dstRect))
return false; return true;
auto rc = SDL_BlitScaled(surface, &srcRect, screen, &dstRect); auto rc = SDL_BlitScaled(surface, &srcRect, screen, &dstRect);
if (rc != 0) if (rc != 0)
{ {