/* Set the clipping rectangle for a blittable surface  */
SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect)
/* Set the clipping rectangle for a blittable surface  */
SDL_bool SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect)
{
	SDL_Rect full_rect;
	if ( ! surface ) {
		return SDL_FALSE;
	}
	full_rect.x = 0;
	full_rect.y = 0;
	full_rect.w = surface->w;
	full_rect.h = surface->h;
	if ( ! rect ) {
		surface->clip_rect = full_rect;
		return 1;
	}
	return SDL_IntersectRect(rect, &full_rect, &surface->clip_rect);
}