mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-21 23:05:49 +00:00
SDL API renaming: SDL_rect.h
Fixes https://github.com/libsdl-org/SDL/issues/6887
This commit is contained in:
@@ -1729,7 +1729,7 @@ int SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
real_rect.w = texture->w;
|
||||
real_rect.h = texture->h;
|
||||
if (rect) {
|
||||
if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) {
|
||||
if (!SDL_GetRectIntersection(rect, &real_rect, &real_rect)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -1895,7 +1895,7 @@ int SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
real_rect.w = texture->w;
|
||||
real_rect.h = texture->h;
|
||||
if (rect) {
|
||||
SDL_IntersectRect(rect, &real_rect, &real_rect);
|
||||
SDL_GetRectIntersection(rect, &real_rect, &real_rect);
|
||||
}
|
||||
|
||||
if (real_rect.w == 0 || real_rect.h == 0) {
|
||||
@@ -1955,7 +1955,7 @@ int SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
real_rect.w = texture->w;
|
||||
real_rect.h = texture->h;
|
||||
if (rect) {
|
||||
SDL_IntersectRect(rect, &real_rect, &real_rect);
|
||||
SDL_GetRectIntersection(rect, &real_rect, &real_rect);
|
||||
}
|
||||
|
||||
if (real_rect.w == 0 || real_rect.h == 0) {
|
||||
@@ -2057,7 +2057,7 @@ int SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
real_rect.w = texture->w;
|
||||
real_rect.h = texture->h;
|
||||
if (rect) {
|
||||
SDL_IntersectRect(rect, &real_rect, &real_rect);
|
||||
SDL_GetRectIntersection(rect, &real_rect, &real_rect);
|
||||
}
|
||||
|
||||
ret = SDL_LockTexture(texture, &real_rect, &pixels, &pitch);
|
||||
@@ -3382,14 +3382,14 @@ int SDL_RenderTextureF(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||
real_srcrect.w = texture->w;
|
||||
real_srcrect.h = texture->h;
|
||||
if (srcrect) {
|
||||
if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) {
|
||||
if (!SDL_GetRectIntersection(srcrect, &real_srcrect, &real_srcrect)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
RenderGetViewportSize(renderer, &real_dstrect);
|
||||
if (dstrect) {
|
||||
if (!SDL_HasIntersectionF(dstrect, &real_dstrect)) {
|
||||
if (!SDL_HasRectIntersectionF(dstrect, &real_dstrect)) {
|
||||
return 0;
|
||||
}
|
||||
real_dstrect = *dstrect;
|
||||
@@ -3522,7 +3522,7 @@ int SDL_RenderTextureRotatedF(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||
real_srcrect.w = texture->w;
|
||||
real_srcrect.h = texture->h;
|
||||
if (srcrect) {
|
||||
if (!SDL_IntersectRect(srcrect, &real_srcrect, &real_srcrect)) {
|
||||
if (!SDL_GetRectIntersection(srcrect, &real_srcrect, &real_srcrect)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -4158,7 +4158,7 @@ int SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect,
|
||||
real_rect.w = (int)SDL_floor(renderer->viewport.w);
|
||||
real_rect.h = (int)SDL_floor(renderer->viewport.h);
|
||||
if (rect) {
|
||||
if (!SDL_IntersectRect(rect, &real_rect, &real_rect)) {
|
||||
if (!SDL_GetRectIntersection(rect, &real_rect, &real_rect)) {
|
||||
return 0;
|
||||
}
|
||||
if (real_rect.y > rect->y) {
|
||||
|
||||
@@ -1252,7 +1252,7 @@ static SDL_bool SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cm
|
||||
METAL_GetOutputSize(renderer, &output.w, &output.h);
|
||||
}
|
||||
|
||||
if (SDL_IntersectRect(&output, &clip, &clip)) {
|
||||
if (SDL_GetRectIntersection(&output, &clip, &clip)) {
|
||||
MTLScissorRect mtlrect;
|
||||
mtlrect.x = clip.x;
|
||||
mtlrect.y = clip.y;
|
||||
|
||||
@@ -223,7 +223,7 @@ int SDL_BlendFillRect(SDL_Surface *dst, const SDL_Rect *rect,
|
||||
/* If 'rect' == NULL, then fill the whole surface */
|
||||
if (rect) {
|
||||
/* Perform clipping */
|
||||
if (!SDL_IntersectRect(rect, &dst->clip_rect, &clipped)) {
|
||||
if (!SDL_GetRectIntersection(rect, &dst->clip_rect, &clipped)) {
|
||||
return 0;
|
||||
}
|
||||
rect = &clipped;
|
||||
@@ -335,7 +335,7 @@ int SDL_BlendFillRects(SDL_Surface *dst, const SDL_Rect *rects, int count,
|
||||
|
||||
for (i = 0; i < count; ++i) {
|
||||
/* Perform clipping */
|
||||
if (!SDL_IntersectRect(&rects[i], &dst->clip_rect, &rect)) {
|
||||
if (!SDL_GetRectIntersection(&rects[i], &dst->clip_rect, &rect)) {
|
||||
continue;
|
||||
}
|
||||
status = func(dst, &rect, blendMode, r, g, b, a);
|
||||
|
||||
@@ -809,7 +809,7 @@ int SDL_BlendLine(SDL_Surface *dst, int x1, int y1, int x2, int y2,
|
||||
|
||||
/* Perform clipping */
|
||||
/* FIXME: We don't actually want to clip, as it may change line slope */
|
||||
if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
|
||||
if (!SDL_GetRectAndLineIntersection(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -843,7 +843,7 @@ int SDL_BlendLines(SDL_Surface *dst, const SDL_Point *points, int count,
|
||||
|
||||
/* Perform clipping */
|
||||
/* FIXME: We don't actually want to clip, as it may change line slope */
|
||||
if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
|
||||
if (!SDL_GetRectAndLineIntersection(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ int SDL_DrawLine(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color)
|
||||
|
||||
/* Perform clipping */
|
||||
/* FIXME: We don't actually want to clip, as it may change line slope */
|
||||
if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
|
||||
if (!SDL_GetRectAndLineIntersection(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ int SDL_DrawLines(SDL_Surface *dst, const SDL_Point *points, int count,
|
||||
|
||||
/* Perform clipping */
|
||||
/* FIXME: We don't actually want to clip, as it may change line slope */
|
||||
if (!SDL_IntersectRectAndLine(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
|
||||
if (!SDL_GetRectAndLineIntersection(&dst->clip_rect, &x1, &y1, &x2, &y2)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -644,7 +644,7 @@ static void SetDrawState(SDL_Surface *surface, SW_DrawStateCache *drawstate)
|
||||
clip_rect.y = cliprect->y + viewport->y;
|
||||
clip_rect.w = cliprect->w;
|
||||
clip_rect.h = cliprect->h;
|
||||
SDL_IntersectRect(viewport, &clip_rect, &clip_rect);
|
||||
SDL_GetRectIntersection(viewport, &clip_rect, &clip_rect);
|
||||
SDL_SetSurfaceClipRect(surface, &clip_rect);
|
||||
} else {
|
||||
SDL_SetSurfaceClipRect(surface, drawstate->viewport);
|
||||
|
||||
@@ -251,14 +251,14 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin
|
||||
rect.y = 0;
|
||||
rect.w = dst->w;
|
||||
rect.h = dst->h;
|
||||
SDL_IntersectRect(&dstrect, &rect, &dstrect);
|
||||
SDL_GetRectIntersection(&dstrect, &rect, &dstrect);
|
||||
}
|
||||
|
||||
{
|
||||
/* Clip triangle with surface clip rect */
|
||||
SDL_Rect rect;
|
||||
SDL_GetSurfaceClipRect(dst, &rect);
|
||||
SDL_IntersectRect(&dstrect, &rect, &dstrect);
|
||||
SDL_GetRectIntersection(&dstrect, &rect, &dstrect);
|
||||
}
|
||||
|
||||
if (blend != SDL_BLENDMODE_NONE) {
|
||||
@@ -547,14 +547,14 @@ int SDL_SW_BlitTriangle(
|
||||
rect.w = dst->w;
|
||||
rect.h = dst->h;
|
||||
|
||||
SDL_IntersectRect(&dstrect, &rect, &dstrect);
|
||||
SDL_GetRectIntersection(&dstrect, &rect, &dstrect);
|
||||
}
|
||||
|
||||
{
|
||||
/* Clip triangle with surface clip rect */
|
||||
SDL_Rect rect;
|
||||
SDL_GetSurfaceClipRect(dst, &rect);
|
||||
SDL_IntersectRect(&dstrect, &rect, &dstrect);
|
||||
SDL_GetRectIntersection(&dstrect, &rect, &dstrect);
|
||||
}
|
||||
|
||||
/* Set destination pointer */
|
||||
|
||||
Reference in New Issue
Block a user