Skip to content

Commit 61bdbac

Browse files
committed
render: SDL_RenderTextureTiled shouldn't try to drop draw calls, either.
1 parent f044a3d commit 61bdbac

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/render/SDL_render.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4287,7 +4287,6 @@ static bool SDL_RenderTextureTiled_Iterate(SDL_Renderer *renderer, SDL_Texture *
42874287
bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect)
42884288
{
42894289
SDL_FRect real_srcrect;
4290-
SDL_FRect real_dstrect;
42914290

42924291
CHECK_RENDERER_MAGIC(renderer, false);
42934292
CHECK_TEXTURE_MAGIC(texture, false);
@@ -4317,12 +4316,10 @@ bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const
43174316
}
43184317
}
43194318

4320-
GetRenderViewportSize(renderer, &real_dstrect);
4321-
if (dstrect) {
4322-
if (!SDL_HasRectIntersectionFloat(dstrect, &real_dstrect)) {
4323-
return true;
4324-
}
4325-
real_dstrect = *dstrect;
4319+
SDL_FRect full_dstrect;
4320+
if (!dstrect) {
4321+
GetRenderViewportSize(renderer, &full_dstrect);
4322+
dstrect = &full_dstrect;
43264323
}
43274324

43284325
if (texture->native) {
@@ -4336,9 +4333,9 @@ bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const
43364333
(!srcrect ||
43374334
(real_srcrect.x == 0.0f && real_srcrect.y == 0.0f &&
43384335
real_srcrect.w == (float)texture->w && real_srcrect.h == (float)texture->h))) {
4339-
return SDL_RenderTextureTiled_Wrap(renderer, texture, &real_srcrect, scale, &real_dstrect);
4336+
return SDL_RenderTextureTiled_Wrap(renderer, texture, &real_srcrect, scale, dstrect);
43404337
} else {
4341-
return SDL_RenderTextureTiled_Iterate(renderer, texture, &real_srcrect, scale, &real_dstrect);
4338+
return SDL_RenderTextureTiled_Iterate(renderer, texture, &real_srcrect, scale, dstrect);
43424339
}
43434340
}
43444341

0 commit comments

Comments
 (0)