MCPcopy Create free account
hub / github.com/devkitPro/3ds-hbmenu / textInit

Function textInit

source/text.c:7–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5static int s_textLang = CFG_LANGUAGE_EN;
6
7void textInit(void)
8{
9 // Ensure the shared system font is mapped
10 fontEnsureMapped();
11
12 // Load the glyph texture sheets
13 int i;
14 TGLP_s* glyphInfo = fontGetGlyphInfo(NULL);
15 s_glyphSheets = malloc(sizeof(C3D_Tex)*glyphInfo->nSheets);
16 s_textScale = 30.0f / glyphInfo->cellHeight;
17 for (i = 0; i < glyphInfo->nSheets; i ++)
18 {
19 C3D_Tex* tex = &s_glyphSheets[i];
20 tex->data = fontGetGlyphSheetTex(NULL, i);
21 tex->fmt = glyphInfo->sheetFmt;
22 tex->size = glyphInfo->sheetSize;
23 tex->width = glyphInfo->sheetWidth;
24 tex->height = glyphInfo->sheetHeight;
25 tex->param = GPU_TEXTURE_MAG_FILTER(GPU_LINEAR) | GPU_TEXTURE_MIN_FILTER(GPU_LINEAR)
26 | GPU_TEXTURE_WRAP_S(GPU_CLAMP_TO_EDGE) | GPU_TEXTURE_WRAP_T(GPU_CLAMP_TO_EDGE);
27 tex->border = 0;
28 tex->lodParam = 0;
29 }
30
31 Result res = cfguInit();
32 if (R_SUCCEEDED(res))
33 {
34 u8 lang;
35 res = CFGU_GetSystemLanguage(&lang);
36 if (R_SUCCEEDED(res))
37 s_textLang = lang;
38 cfguExit();
39 }
40}
41
42void textExit(void)
43{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected