MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / TexIdsOverlay_BuildText

Function TexIdsOverlay_BuildText

src/Menus.c:2543–2567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2541}
2542
2543static void TexIdsOverlay_BuildText(struct TexIdsOverlay* s, struct VertexTextured** ptr) {
2544 struct TextAtlas* idAtlas;
2545 struct VertexTextured* beg;
2546 int xOffset, size, row;
2547 int x, y, id = 0;
2548
2549 size = s->tileSize;
2550 xOffset = s->xOffset;
2551 idAtlas = &s->idAtlas;
2552 beg = *ptr;
2553
2554 for (row = 0; row < Atlas2D.RowsCount; row += TEXIDS_MAX_ROWS_PER_PAGE) {
2555 idAtlas->tex.y = s->yOffset + (size - idAtlas->tex.height);
2556
2557 for (y = 0; y < ATLAS2D_TILES_PER_ROW; y++) {
2558 for (x = 0; x < ATLAS2D_TILES_PER_ROW; x++) {
2559 idAtlas->curX = xOffset + size * x + 3; /* offset text by 3 pixels */
2560 TextAtlas_AddInt(idAtlas, id++, ptr);
2561 }
2562 idAtlas->tex.y += size;
2563 }
2564 xOffset += size * ATLAS2D_TILES_PER_ROW;
2565 }
2566 s->textVertices = (int)(*ptr - beg);
2567}
2568
2569static void TexIdsOverlay_BuildMesh(void* screen) {
2570 struct TexIdsOverlay* s = (struct TexIdsOverlay*)screen;

Callers 1

TexIdsOverlay_BuildMeshFunction · 0.85

Calls 1

TextAtlas_AddIntFunction · 0.85

Tested by

no test coverage detected