change Wellspring_Draw to Wellspring_AddToTextBatch
continuous-integration/drone/push Build is passing Details

pull/1/head
cosmonaut 2023-12-09 17:40:02 -08:00
parent 086e452e15
commit 1cba7f3faa
2 changed files with 7 additions and 12 deletions

View File

@ -138,12 +138,9 @@ WELLSPRINGAPI uint8_t Wellspring_TextBounds(
Wellspring_Rectangle *pRectangle
);
WELLSPRINGAPI uint8_t Wellspring_Draw(
WELLSPRINGAPI uint8_t Wellspring_AddToTextBatch(
Wellspring_TextBatch *textBatch,
float x,
float y,
int pixelSize,
float depth,
Wellspring_Color *color,
Wellspring_HorizontalAlignment horizontalAlignment,
Wellspring_VerticalAlignment verticalAlignment,

View File

@ -729,12 +729,9 @@ uint8_t Wellspring_TextBounds(
);
}
uint8_t Wellspring_Draw(
uint8_t Wellspring_AddToTextBatch(
Wellspring_TextBatch *textBatch,
float x,
float y,
int pixelSize,
float depth,
Wellspring_Color *color,
Wellspring_HorizontalAlignment horizontalAlignment,
Wellspring_VerticalAlignment verticalAlignment,
@ -756,6 +753,7 @@ uint8_t Wellspring_Draw(
Wellspring_Rectangle bounds;
uint32_t i, j;
float sizeFactor = pixelSize / font->pixelsPerEm;
float x = 0, y = 0;
y += Wellspring_INTERNAL_GetVerticalAlignOffset(font, verticalAlignment, sizeFactor * font->scale);
@ -858,7 +856,7 @@ uint8_t Wellspring_Draw(
batch->vertices[vertexBufferIndex].x = charQuad.x0;
batch->vertices[vertexBufferIndex].y = charQuad.y0;
batch->vertices[vertexBufferIndex].z = depth;
batch->vertices[vertexBufferIndex].z = 0;
batch->vertices[vertexBufferIndex].u = charQuad.s0;
batch->vertices[vertexBufferIndex].v = charQuad.t0;
batch->vertices[vertexBufferIndex].r = color->r;
@ -868,7 +866,7 @@ uint8_t Wellspring_Draw(
batch->vertices[vertexBufferIndex + 1].x = charQuad.x0;
batch->vertices[vertexBufferIndex + 1].y = charQuad.y1;
batch->vertices[vertexBufferIndex + 1].z = depth;
batch->vertices[vertexBufferIndex + 1].z = 0;
batch->vertices[vertexBufferIndex + 1].u = charQuad.s0;
batch->vertices[vertexBufferIndex + 1].v = charQuad.t1;
batch->vertices[vertexBufferIndex + 1].r = color->r;
@ -878,7 +876,7 @@ uint8_t Wellspring_Draw(
batch->vertices[vertexBufferIndex + 2].x = charQuad.x1;
batch->vertices[vertexBufferIndex + 2].y = charQuad.y0;
batch->vertices[vertexBufferIndex + 2].z = depth;
batch->vertices[vertexBufferIndex + 2].z = 0;
batch->vertices[vertexBufferIndex + 2].u = charQuad.s1;
batch->vertices[vertexBufferIndex + 2].v = charQuad.t0;
batch->vertices[vertexBufferIndex + 2].r = color->r;
@ -888,7 +886,7 @@ uint8_t Wellspring_Draw(
batch->vertices[vertexBufferIndex + 3].x = charQuad.x1;
batch->vertices[vertexBufferIndex + 3].y = charQuad.y1;
batch->vertices[vertexBufferIndex + 3].z = depth;
batch->vertices[vertexBufferIndex + 3].z = 0;
batch->vertices[vertexBufferIndex + 3].u = charQuad.s1;
batch->vertices[vertexBufferIndex + 3].v = charQuad.t1;
batch->vertices[vertexBufferIndex + 3].r = color->r;