mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-05-21 23:39:17 +08:00
Merge pull request #518 from Wryyyong/patch-1
Very minor fix for libctru 1.6.0 compatibility
This commit is contained in:
commit
c6d92d86b2
@ -137,7 +137,7 @@ void screen_init() {
|
||||
return;
|
||||
}
|
||||
|
||||
TGLP_s* glyphInfo = fontGetGlyphInfo();
|
||||
TGLP_s* glyphInfo = fontGetGlyphInfo(NULL);
|
||||
|
||||
glyph_count = glyphInfo->nSheets;
|
||||
glyph_sheets = calloc(glyph_count, sizeof(C3D_Tex));
|
||||
@ -148,7 +148,7 @@ void screen_init() {
|
||||
|
||||
for(int i = 0; i < glyph_count; i++) {
|
||||
C3D_Tex* tex = &glyph_sheets[i];
|
||||
tex->data = fontGetGlyphSheetTex(i);
|
||||
tex->data = fontGetGlyphSheetTex(NULL, i);
|
||||
tex->fmt = (GPU_TEXCOLOR) glyphInfo->sheetFmt;
|
||||
tex->size = glyphInfo->sheetSize;
|
||||
tex->width = glyphInfo->sheetWidth;
|
||||
@ -491,7 +491,7 @@ void screen_draw_texture_crop(u32 id, float x, float y, float width, float heigh
|
||||
}
|
||||
|
||||
float screen_get_font_height(float scaleY) {
|
||||
return scaleY * fontGetInfo()->lineFeed;
|
||||
return scaleY * fontGetInfo(NULL)->lineFeed;
|
||||
}
|
||||
|
||||
#define MAX_LINES 64
|
||||
@ -558,12 +558,12 @@ static void screen_wrap_string(u32* lines, float* lineWidths, float* lineHeights
|
||||
lastAlignPos = linePos;
|
||||
}
|
||||
|
||||
charWidth *= scaleX * fontGetCharWidthInfo(fontGlyphIndexFromCodePoint(code))->charWidth;
|
||||
charWidth *= scaleX * fontGetCharWidthInfo(NULL, fontGlyphIndexFromCodePoint(NULL, code))->charWidth;
|
||||
|
||||
if(code == '\n' || (wordWrap && lw + charWidth >= maxWidth)) {
|
||||
if(code == '\n') {
|
||||
linePos++;
|
||||
lh = scaleY * fontGetInfo()->lineFeed;
|
||||
lh = scaleY * fontGetInfo(NULL)->lineFeed;
|
||||
}
|
||||
|
||||
u32 oldLinePos = linePos;
|
||||
@ -600,7 +600,7 @@ static void screen_wrap_string(u32* lines, float* lineWidths, float* lineHeights
|
||||
}
|
||||
|
||||
lw += charWidth;
|
||||
lh = scaleY * fontGetInfo()->lineFeed;
|
||||
lh = scaleY * fontGetInfo(NULL)->lineFeed;
|
||||
|
||||
linePos++;
|
||||
}
|
||||
@ -692,10 +692,10 @@ static void screen_draw_string_internal(const char* text, float x, float y, floa
|
||||
}
|
||||
|
||||
fontGlyphPos_s data;
|
||||
fontCalcGlyphPos(&data, fontGlyphIndexFromCodePoint(code), GLYPH_POS_CALC_VTXCOORD, scaleX * font_scale, scaleY * font_scale);
|
||||
fontCalcGlyphPos(&data, NULL, fontGlyphIndexFromCodePoint(NULL, code), GLYPH_POS_CALC_VTXCOORD, scaleX * font_scale, scaleY * font_scale);
|
||||
|
||||
if(data.sheetIndex >= glyph_count) {
|
||||
fontCalcGlyphPos(&data, fontGlyphIndexFromCodePoint(0xFFFD), GLYPH_POS_CALC_VTXCOORD, scaleX * font_scale, scaleY * font_scale);
|
||||
fontCalcGlyphPos(&data, NULL, fontGlyphIndexFromCodePoint(NULL, 0xFFFD), GLYPH_POS_CALC_VTXCOORD, scaleX * font_scale, scaleY * font_scale);
|
||||
}
|
||||
|
||||
if(data.sheetIndex < glyph_count && data.sheetIndex != lastSheet) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user