From 8aecc2bd062c2da7a7d9ea25a8eca200c51f3b14 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Tue, 22 Oct 2024 10:05:53 +0300 Subject: [PATCH] fix rects render --- src/rendering/twn_gl_15_rendering.c | 4 ++-- src/rendering/twn_rects.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rendering/twn_gl_15_rendering.c b/src/rendering/twn_gl_15_rendering.c index f064a63..68a90e4 100644 --- a/src/rendering/twn_gl_15_rendering.c +++ b/src/rendering/twn_gl_15_rendering.c @@ -693,9 +693,9 @@ size_t get_quad_payload_size(struct QuadBatch batch) { else if (!batch.constant_colored && batch.textured) return sizeof (ElementIndexedQuad); else if (batch.constant_colored && !batch.textured) - return sizeof (ElementIndexedQuadWithoutTexture); - else if (!batch.constant_colored && !batch.textured) return sizeof (ElementIndexedQuadWithoutColorWithoutTexture); + else if (!batch.constant_colored && !batch.textured) + return sizeof (ElementIndexedQuadWithoutTexture); SDL_assert(false); return 0; diff --git a/src/rendering/twn_rects.c b/src/rendering/twn_rects.c index 3d88f11..df66c74 100644 --- a/src/rendering/twn_rects.c +++ b/src/rendering/twn_rects.c @@ -85,8 +85,8 @@ void render_rect_batch(const Primitive2D primitives[], const size_t cur = batch.mode == TEXTURE_MODE_GHOSTLY ? i : batch.size - i - 1; const RectPrimitive rect = primitives[cur].rect; - Vec2 v0 = { rect.rect.x, rect.rect.y }; - Vec2 v1 = { rect.rect.x, rect.rect.y + rect.rect.h }; + Vec2 v0 = { rect.rect.x, rect.rect.y }; + Vec2 v1 = { rect.rect.x, rect.rect.y + rect.rect.h }; Vec2 v2 = { rect.rect.x + rect.rect.w, rect.rect.y + rect.rect.h }; Vec2 v3 = { rect.rect.x + rect.rect.w, rect.rect.y };