mirror of
https://github.com/BernardoGiordano/Checkpoint
synced 2024-11-15 06:07:06 +00:00
Fix compilation with latest libctru
This commit is contained in:
parent
cb773c8dfb
commit
97d6ccfd9a
4 changed files with 8 additions and 8 deletions
|
@ -66,7 +66,7 @@ void Clickable::draw(float size, u32 overlay)
|
|||
const u8 r = overlay & 0xFF;
|
||||
const u8 g = (overlay >> 8) & 0xFF;
|
||||
const u8 b = (overlay >> 16) & 0xFF;
|
||||
const float messageHeight = ceilf(size * fontGetInfo()->lineFeed);
|
||||
const float messageHeight = ceilf(size * fontGetInfo(NULL)->lineFeed);
|
||||
const float messageWidth = mCentered ? mC2dText.width * size : mw - (mSelected ? 20 : 8);
|
||||
|
||||
C2D_DrawRectSolid(mx, my, 0.5f, mw, mh, mColorBg);
|
||||
|
|
|
@ -82,7 +82,7 @@ void Gui::drawCopy(const std::u16string& src, u32 offset, u32 size)
|
|||
C2D_TextOptimize(&srcText);
|
||||
C2D_TextOptimize(©Text);
|
||||
const float scale = 0.6f;
|
||||
const u32 size_h = scale * fontGetInfo()->lineFeed;
|
||||
const u32 size_h = scale * fontGetInfo(NULL)->lineFeed;
|
||||
const u32 src_w = StringUtils::textWidth(srcText, scale);
|
||||
const u32 size_w = StringUtils::textWidth(copyText, scale);
|
||||
|
||||
|
@ -126,7 +126,7 @@ bool Gui::askForConfirmation(const std::string& message)
|
|||
C3D_FrameBegin(C3D_FRAME_SYNCDRAW);
|
||||
C2D_SceneBegin(g_bottom);
|
||||
C2D_DrawRectSolid(40, 40, 0.5f, 240, 160, COLOR_GREY_DARK);
|
||||
C2D_DrawText(&text, C2D_WithColor, ceilf(320 - text.width * 0.6) / 2, 40 + ceilf(120 - 0.6f * fontGetInfo()->lineFeed) / 2, 0.5f, 0.6f, 0.6f,
|
||||
C2D_DrawText(&text, C2D_WithColor, ceilf(320 - text.width * 0.6) / 2, 40 + ceilf(120 - 0.6f * fontGetInfo(NULL)->lineFeed) / 2, 0.5f, 0.6f, 0.6f,
|
||||
COLOR_WHITE);
|
||||
C2D_DrawRectSolid(40, 160, 0.5f, 240, 40, COLOR_GREY_LIGHT);
|
||||
|
||||
|
@ -459,7 +459,7 @@ void Gui::draw(void)
|
|||
C2D_DrawText(&ins3, C2D_WithColor, border + ceilf((ins1.width + ins2.width) * 0.47f), 223, 0.5f, 0.47f, 0.47f, COLOR_WHITE);
|
||||
|
||||
if (hidKeysHeld() & KEY_SELECT) {
|
||||
const u32 inst_lh = scaleInst * fontGetInfo()->lineFeed;
|
||||
const u32 inst_lh = scaleInst * fontGetInfo(NULL)->lineFeed;
|
||||
const u32 inst_h = ceilf((240 - scaleInst * inst_lh * 6) / 2);
|
||||
C2D_DrawRectSolid(0, 0, 0.5f, 400, 240, C2D_Color32(0, 0, 0, 190));
|
||||
C2D_DrawText(&top_move, C2D_WithColor, ceilf((400 - StringUtils::textWidth(top_move, scaleInst)) / 2), inst_h, 0.9f, scaleInst, scaleInst,
|
||||
|
|
|
@ -148,7 +148,7 @@ std::string StringUtils::splitWord(const std::string& text, float scaleX, float
|
|||
charWidth = width->second->charWidth * scaleX;
|
||||
}
|
||||
else {
|
||||
widthCache.insert_or_assign(codepoint, fontGetCharWidthInfo(fontGlyphIndexFromCodePoint(codepoint)));
|
||||
widthCache.insert_or_assign(codepoint, fontGetCharWidthInfo(NULL, fontGlyphIndexFromCodePoint(NULL, codepoint)));
|
||||
widthCacheOrder.push(codepoint);
|
||||
if (widthCache.size() > 512) {
|
||||
widthCache.erase(widthCacheOrder.front());
|
||||
|
@ -199,7 +199,7 @@ float StringUtils::textWidth(const std::string& text, float scaleX)
|
|||
charWidth = width->second->charWidth * scaleX;
|
||||
}
|
||||
else {
|
||||
widthCache.insert_or_assign(codepoint, fontGetCharWidthInfo(fontGlyphIndexFromCodePoint(codepoint)));
|
||||
widthCache.insert_or_assign(codepoint, fontGetCharWidthInfo(NULL, fontGlyphIndexFromCodePoint(NULL, codepoint)));
|
||||
widthCacheOrder.push(codepoint);
|
||||
if (widthCache.size() > 1000) {
|
||||
widthCache.erase(widthCacheOrder.front());
|
||||
|
@ -277,5 +277,5 @@ std::string StringUtils::wrap(const std::string& text, float scaleX, float maxWi
|
|||
float StringUtils::textHeight(const std::string& text, float scaleY)
|
||||
{
|
||||
size_t n = std::count(text.begin(), text.end(), '\n') + 1;
|
||||
return ceilf(scaleY * fontGetInfo()->lineFeed * n);
|
||||
return ceilf(scaleY * fontGetInfo(NULL)->lineFeed * n);
|
||||
}
|
|
@ -41,7 +41,7 @@ class Scrollable;
|
|||
|
||||
class MainScreen : public Screen {
|
||||
public:
|
||||
MainScreen();
|
||||
MainScreen(void);
|
||||
void draw(void) const override;
|
||||
void update(touchPosition* touch) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue