mirror of
https://github.com/nicbarker/clay.git
synced 2025-04-19 04:38:01 +00:00
Update rounded rect to use fixed length arrays to support MSVC
This commit is contained in:
parent
317add7a07
commit
3ff71aba14
@ -53,11 +53,8 @@ static void SDL_RenderFillRoundedRect(SDL_Renderer* renderer, const SDL_FRect re
|
|||||||
|
|
||||||
const int numCircleSegments = SDL_max(NUM_CIRCLE_SEGMENTS, (int)clampedRadius * 0.5f);
|
const int numCircleSegments = SDL_max(NUM_CIRCLE_SEGMENTS, (int)clampedRadius * 0.5f);
|
||||||
|
|
||||||
int totalVertices = 4 + (4 * (numCircleSegments * 2)) + 2 * 4;
|
SDL_Vertex vertices[512];
|
||||||
int totalIndices = 6 + (4 * (numCircleSegments * 3)) + 6 * 4;
|
int indices[512];
|
||||||
|
|
||||||
SDL_Vertex vertices[totalVertices];
|
|
||||||
int indices[totalIndices];
|
|
||||||
|
|
||||||
//define center rectangle
|
//define center rectangle
|
||||||
vertices[vertexCount++] = (SDL_Vertex){ {rect.x + clampedRadius, rect.y + clampedRadius}, color, {0, 0} }; //0 center TL
|
vertices[vertexCount++] = (SDL_Vertex){ {rect.x + clampedRadius, rect.y + clampedRadius}, color, {0, 0} }; //0 center TL
|
||||||
|
Loading…
Reference in New Issue
Block a user