From 8ea8b2e697b47a6c7786061b43dd3aeed0200870 Mon Sep 17 00:00:00 2001 From: Sylvain Date: Fri, 7 Jan 2022 22:42:13 +0100 Subject: [PATCH] Use QueueDrawLine if provided, otherwise use RenderGeometry --- src/render/SDL_render.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index d4668f699..5293c0a50 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -890,7 +890,7 @@ void VerifyDrawQueueFunctions(const SDL_Renderer *renderer) SDL_assert(renderer->QueueSetViewport != NULL); SDL_assert(renderer->QueueSetDrawColor != NULL); SDL_assert(renderer->QueueDrawPoints != NULL); - SDL_assert(renderer->QueueDrawLines != NULL); + SDL_assert(renderer->QueueDrawLines != NULL || renderer->QueueGeometry != NULL); SDL_assert(renderer->QueueFillRects != NULL || renderer->QueueGeometry != NULL); SDL_assert(renderer->QueueCopy != NULL || renderer->QueueGeometry != NULL); SDL_assert(renderer->RunCommandQueue != NULL); @@ -2963,6 +2963,7 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, const SDL_FPoint * points, int count) { int retval = 0; + int use_rendergeometry; CHECK_RENDERER_MAGIC(renderer, -1); @@ -2983,8 +2984,10 @@ SDL_RenderDrawLinesF(SDL_Renderer * renderer, if (renderer->scale.x != 1.0f || renderer->scale.y != 1.0f) { return RenderDrawLinesWithRectsF(renderer, points, count); } + + use_rendergeometry = (renderer->QueueDrawLines == NULL); - if (!(renderer->info.flags & SDL_RENDERER_SOFTWARE) && renderer->QueueGeometry) { + if (use_rendergeometry) { SDL_bool isstack1; SDL_bool isstack2; float *xy = SDL_small_alloc(float, 4 * 2 * count, &isstack1);