From 71947a76490b97e88099bd41559e8175a623469e Mon Sep 17 00:00:00 2001 From: Wrong Date: Fri, 18 Oct 2019 23:34:34 +0800 Subject: [PATCH] Very minor fix for libctru 1.6.0 compatibility 3dsx and cia builds working on O3DS 11.11.0-43E --- source/core/screen.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/core/screen.c b/source/core/screen.c index 3c68d95..c159433 100644 --- a/source/core/screen.c +++ b/source/core/screen.c @@ -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) {