fix rects render

This commit is contained in:
veclavtalica 2024-10-22 10:05:53 +03:00
parent 1296d41ad7
commit 8aecc2bd06
2 changed files with 4 additions and 4 deletions

View File

@ -693,9 +693,9 @@ size_t get_quad_payload_size(struct QuadBatch batch) {
else if (!batch.constant_colored && batch.textured) else if (!batch.constant_colored && batch.textured)
return sizeof (ElementIndexedQuad); return sizeof (ElementIndexedQuad);
else if (batch.constant_colored && !batch.textured) else if (batch.constant_colored && !batch.textured)
return sizeof (ElementIndexedQuadWithoutTexture);
else if (!batch.constant_colored && !batch.textured)
return sizeof (ElementIndexedQuadWithoutColorWithoutTexture); return sizeof (ElementIndexedQuadWithoutColorWithoutTexture);
else if (!batch.constant_colored && !batch.textured)
return sizeof (ElementIndexedQuadWithoutTexture);
SDL_assert(false); SDL_assert(false);
return 0; return 0;

View File

@ -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 size_t cur = batch.mode == TEXTURE_MODE_GHOSTLY ? i : batch.size - i - 1;
const RectPrimitive rect = primitives[cur].rect; const RectPrimitive rect = primitives[cur].rect;
Vec2 v0 = { rect.rect.x, rect.rect.y }; Vec2 v0 = { rect.rect.x, rect.rect.y };
Vec2 v1 = { rect.rect.x, rect.rect.y + rect.rect.h }; 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 v2 = { rect.rect.x + rect.rect.w, rect.rect.y + rect.rect.h };
Vec2 v3 = { rect.rect.x + rect.rect.w, rect.rect.y }; Vec2 v3 = { rect.rect.x + rect.rect.w, rect.rect.y };