Skip to content

Commit

Permalink
Fix small compilation issues on latest devkitARM
Browse files Browse the repository at this point in the history
  • Loading branch information
piepie62 committed May 18, 2024
1 parent e8ff940 commit d896875
Show file tree
Hide file tree
Showing 18 changed files with 146 additions and 119 deletions.
5 changes: 3 additions & 2 deletions 3ds/source/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "thread.hpp"
#include "TitleLoadScreen.hpp"
#include "utils/crypto.hpp"
#include "utils/format.hpp"
#include "website.h"
#include <3ds.h>
#include <array>
Expand Down Expand Up @@ -818,8 +819,8 @@ namespace

while (filesDone != filesToDownload)
{
Gui::waitFrame(std::vformat(i18n::localize("MYSTERY_GIFT_DOWNLOAD"),
std::make_format_args((size_t)filesDone, filesToDownload)));
Gui::waitFrame(pksm::format(
i18n::localize("MYSTERY_GIFT_DOWNLOAD"), (size_t)filesDone, filesToDownload));
svcSleepThread(50'000'000);
}

Expand Down
20 changes: 9 additions & 11 deletions 3ds/source/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
#include "pkx/PKX.hpp"
#include "sound.hpp"
#include "TextParse.hpp"
#include "thread.hpp"
#include <format>
#include "utils/format.hpp"
#include <stack>

namespace
Expand Down Expand Up @@ -2041,8 +2040,8 @@ void Gui::showRestoreProgress(u32 partial, u32 total)
sprite(ui_sheet_part_info_top_idx, 0, 0);
text(i18n::localize("SAVING"), 200, 95, FONT_SIZE_15, COLOR_WHITE, TextPosX::CENTER,
TextPosY::TOP);
text(std::vformat(i18n::localize("SAVE_PROGRESS"), std::make_format_args(partial, total)), 200,
130, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
text(pksm::format(i18n::localize("SAVE_PROGRESS"), partial, total), 200, 130, FONT_SIZE_12,
COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
flushText();

target(GFX_BOTTOM);
Expand Down Expand Up @@ -2070,10 +2069,10 @@ void Gui::showDownloadProgress(const std::string& path, u32 partial, u32 total)
Gui::clearScreen(GFX_BOTTOM);
target(GFX_TOP);
sprite(ui_sheet_part_info_top_idx, 0, 0);
text(std::vformat(i18n::localize("DOWNLOADING_FILE"), std::make_format_args(path)), 200, 95,
FONT_SIZE_15, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
text(std::vformat(i18n::localize("SAVE_PROGRESS"), std::make_format_args(partial, total)), 200,
130, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
text(pksm::format(i18n::localize("DOWNLOADING_FILE"), path), 200, 95, FONT_SIZE_15, COLOR_WHITE,
TextPosX::CENTER, TextPosY::TOP);
text(pksm::format(i18n::localize("SAVE_PROGRESS"), partial, total), 200, 130, FONT_SIZE_12,
COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
flushText();

target(GFX_BOTTOM);
Expand Down Expand Up @@ -2138,9 +2137,8 @@ void Gui::error(const std::string& message, Result errorCode)
u8 transparency = transparencyWaver();
text(message, 200, 85, FONT_SIZE_15, PKSM_Color(255, 255, 255, transparency),
TextPosX::CENTER, TextPosY::TOP);
text(std::vformat(i18n::localize("ERROR_CODE"), std::make_format_args((u32)errorCode)), 200,
105, FONT_SIZE_15, PKSM_Color(255, 255, 255, transparency), TextPosX::CENTER,
TextPosY::TOP);
text(pksm::format(i18n::localize("ERROR_CODE"), (u32)errorCode), 200, 105, FONT_SIZE_15,
PKSM_Color(255, 255, 255, transparency), TextPosX::CENTER, TextPosY::TOP);

text(i18n::localize("CONTINUE"), 200, 130, FONT_SIZE_11, COLOR_WHITE, TextPosX::CENTER,
TextPosY::TOP);
Expand Down
5 changes: 3 additions & 2 deletions 3ds/source/gui/overlay/ViewOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "pkx/PK1.hpp"
#include "pkx/PK2.hpp"
#include "pkx/PK3.hpp"
#include "utils/format.hpp"
#include <format>

namespace
Expand Down Expand Up @@ -226,8 +227,8 @@ void ViewOverlay::drawPkm(pksm::PKX& pkm) const
case pksm::Gender::INVALID:
break;
}
Gui::text(std::vformat(i18n::localize("LVL"), std::make_format_args(pkm.level())), 143, 10,
FONT_SIZE_9, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(pksm::format(i18n::localize("LVL"), pkm.level()), 143, 10, FONT_SIZE_9, COLOR_WHITE,
TextPosX::LEFT, TextPosY::TOP);
if (pkm.shiny())
{
Gui::sprite(ui_sheet_icon_shiny_idx, 191, 5);
Expand Down
6 changes: 3 additions & 3 deletions 3ds/source/gui/screen/BankSelectionScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#include "Configuration.hpp"
#include "gui.hpp"
#include "i18n_ext.hpp"
#include "utils/format.hpp"
#include <algorithm>
#include <format>

BankSelectionScreen::BankSelectionScreen(int& storageBox)
: hid(40, 2), strings(Banks::bankNames()), storageBox(storageBox)
Expand Down Expand Up @@ -129,8 +129,8 @@ void BankSelectionScreen::update(touchPosition* touch)
}
if (strings.size() > 2)
{
if (Gui::showChoiceMessage(std::vformat(i18n::localize("BANK_DELETE"),
std::make_format_args(strings[hid.fullIndex()].first))))
if (Gui::showChoiceMessage(
pksm::format(i18n::localize("BANK_DELETE"), strings[hid.fullIndex()].first)))
{
auto i = strings.begin() + hid.fullIndex();
Banks::removeBank(i->first);
Expand Down
15 changes: 7 additions & 8 deletions 3ds/source/gui/screen/CloudScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include "QRScanner.hpp"
#include "revision.h"
#include "sav/Sav.hpp"
#include "utils/format.hpp"
#include "website.h"
#include <format>
#include <sys/stat.h>
Expand Down Expand Up @@ -208,8 +209,8 @@ void CloudScreen::drawTop() const
"\uE004", 45 + 24 / 2, 24, FONT_SIZE_14, COLOR_BLACK, TextPosX::CENTER, TextPosY::TOP);
Gui::text(
"\uE005", 225 + 24 / 2, 24, FONT_SIZE_14, COLOR_BLACK, TextPosX::CENTER, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("CLOUD_BOX"), std::make_format_args(access.page())),
69 + 156 / 2, 24, FONT_SIZE_14, COLOR_BLACK, TextPosX::CENTER, TextPosY::TOP);
Gui::text(pksm::format(i18n::localize("CLOUD_BOX"), access.page()), 69 + 156 / 2, 24,
FONT_SIZE_14, COLOR_BLACK, TextPosX::CENTER, TextPosY::TOP);

Gui::sprite(ui_sheet_storagemenu_cross_idx, 36, 50);
Gui::sprite(ui_sheet_storagemenu_cross_idx, 246, 50);
Expand Down Expand Up @@ -344,8 +345,8 @@ void CloudScreen::update(touchPosition* touch)
{
if (access.currentPageError() != 0)
{
Gui::warn(std::vformat(i18n::localize("GPSS_COMMUNICATION_ERROR"),
std::make_format_args(access.currentPageError())));
Gui::warn(pksm::format(
i18n::localize("GPSS_COMMUNICATION_ERROR"), access.currentPageError()));
}
else
{
Expand Down Expand Up @@ -644,8 +645,7 @@ bool CloudScreen::prevBoxTop()
{
if (*err != 0)
{
Gui::warn(std::vformat(
i18n::localize("GPSS_COMMUNICATION_ERROR"), std::make_format_args(*err)));
Gui::warn(pksm::format(i18n::localize("GPSS_COMMUNICATION_ERROR"), *err));
}
else
{
Expand Down Expand Up @@ -680,8 +680,7 @@ bool CloudScreen::nextBoxTop()
{
if (*err != 0)
{
Gui::warn(std::vformat(
i18n::localize("GPSS_COMMUNICATION_ERROR"), std::make_format_args(*err)));
Gui::warn(pksm::format(i18n::localize("GPSS_COMMUNICATION_ERROR"), *err));
}
else
{
Expand Down
28 changes: 10 additions & 18 deletions 3ds/source/gui/screen/ConfigScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "thread.hpp"
#include "TitleIdOverlay.hpp"
#include "ToggleButton.hpp"
#include "utils/format.hpp"
#include <format>

namespace
Expand Down Expand Up @@ -654,32 +655,23 @@ void ConfigScreen::drawBottom() const
}
else if (currentTab == 1)
{
Gui::text(std::vformat(i18n::localize("GENERATION"),
std::make_format_args((std::string)pksm::Generation::ONE)),
Gui::text(pksm::format(i18n::localize("GENERATION"), (std::string)pksm::Generation::ONE),
19, 30, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("GENERATION"),
std::make_format_args((std::string)pksm::Generation::TWO)),
Gui::text(pksm::format(i18n::localize("GENERATION"), (std::string)pksm::Generation::TWO),
19, 46, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("GENERATION"),
std::make_format_args((std::string)pksm::Generation::THREE)),
Gui::text(pksm::format(i18n::localize("GENERATION"), (std::string)pksm::Generation::THREE),
19, 62, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("GENERATION"),
std::make_format_args((std::string)pksm::Generation::FOUR)),
Gui::text(pksm::format(i18n::localize("GENERATION"), (std::string)pksm::Generation::FOUR),
19, 78, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("GENERATION"),
std::make_format_args((std::string)pksm::Generation::FIVE)),
Gui::text(pksm::format(i18n::localize("GENERATION"), (std::string)pksm::Generation::FIVE),
19, 94, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("GENERATION"),
std::make_format_args((std::string)pksm::Generation::SIX)),
Gui::text(pksm::format(i18n::localize("GENERATION"), (std::string)pksm::Generation::SIX),
19, 110, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("GENERATION"),
std::make_format_args((std::string)pksm::Generation::SEVEN)),
Gui::text(pksm::format(i18n::localize("GENERATION"), (std::string)pksm::Generation::SEVEN),
19, 126, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("GENERATION"),
std::make_format_args((std::string)pksm::Generation::LGPE)),
Gui::text(pksm::format(i18n::localize("GENERATION"), (std::string)pksm::Generation::LGPE),
19, 142, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("GENERATION"),
std::make_format_args((std::string)pksm::Generation::EIGHT)),
Gui::text(pksm::format(i18n::localize("GENERATION"), (std::string)pksm::Generation::EIGHT),
19, 158, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT, TextPosY::TOP);
Gui::text(i18n::localize("DAY"), 19, 174, FONT_SIZE_12, COLOR_WHITE, TextPosX::LEFT,
TextPosY::TOP);
Expand Down
6 changes: 3 additions & 3 deletions 3ds/source/gui/screen/EditSelectorScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "pkx/PK8.hpp"
#include "QRScanner.hpp"
#include "sav/SavLGPE.hpp"
#include "utils/format.hpp"
#include "ViewOverlay.hpp"
#include <format>
#include <memory>
Expand Down Expand Up @@ -410,9 +411,8 @@ void EditSelectorScreen::drawBottom() const

if (infoMon)
{
Gui::text(
std::vformat(i18n::localize("EDITOR_IDS"),
std::make_format_args(infoMon->formatTID(), infoMon->formatSID(), infoMon->TSV())),
Gui::text(pksm::format(i18n::localize("EDITOR_IDS"), infoMon->formatTID(),
infoMon->formatSID(), infoMon->TSV()),
160, 224, FONT_SIZE_9, COLOR_BLACK, TextPosX::CENTER, TextPosY::TOP);
}

Expand Down
15 changes: 7 additions & 8 deletions 3ds/source/gui/screen/GroupCloudScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "pkx/PKFilter.hpp"
#include "QRScanner.hpp"
#include "sav/Sav.hpp"
#include "utils/format.hpp"
#include "website.h"
#include <algorithm>
#include <format>
Expand Down Expand Up @@ -221,8 +222,8 @@ void GroupCloudScreen::drawTop() const
"\uE004", 45 + 24 / 2, 24, FONT_SIZE_14, COLOR_BLACK, TextPosX::CENTER, TextPosY::TOP);
Gui::text(
"\uE005", 225 + 24 / 2, 24, FONT_SIZE_14, COLOR_BLACK, TextPosX::CENTER, TextPosY::TOP);
Gui::text(std::vformat(i18n::localize("CLOUD_BOX"), std::make_format_args(access.page())),
69 + 156 / 2, 24, FONT_SIZE_14, COLOR_BLACK, TextPosX::CENTER, TextPosY::TOP);
Gui::text(pksm::format(i18n::localize("CLOUD_BOX"), access.page()), 69 + 156 / 2, 24,
FONT_SIZE_14, COLOR_BLACK, TextPosX::CENTER, TextPosY::TOP);

Gui::sprite(ui_sheet_storagemenu_cross_idx, 36, 50);
Gui::sprite(ui_sheet_storagemenu_cross_idx, 246, 50);
Expand Down Expand Up @@ -364,8 +365,8 @@ void GroupCloudScreen::update(touchPosition* touch)
{
if (access.currentPageError() != 0)
{
Gui::warn(std::vformat(i18n::localize("GPSS_COMMUNICATION_ERROR"),
std::make_format_args(access.currentPageError())));
Gui::warn(pksm::format(
i18n::localize("GPSS_COMMUNICATION_ERROR"), access.currentPageError()));
}
else
{
Expand Down Expand Up @@ -647,8 +648,7 @@ bool GroupCloudScreen::prevBoxTop()
{
if (*err != 0)
{
Gui::warn(std::vformat(
i18n::localize("GPSS_COMMUNICATION_ERROR"), std::make_format_args(*err)));
Gui::warn(pksm::format(i18n::localize("GPSS_COMMUNICATION_ERROR"), *err));
}
else
{
Expand Down Expand Up @@ -683,8 +683,7 @@ bool GroupCloudScreen::nextBoxTop()
{
if (*err != 0)
{
Gui::warn(std::vformat(
i18n::localize("GPSS_COMMUNICATION_ERROR"), std::make_format_args(*err)));
Gui::warn(pksm::format(i18n::localize("GPSS_COMMUNICATION_ERROR"), *err));
}
else
{
Expand Down
31 changes: 13 additions & 18 deletions 3ds/source/gui/screen/HexEditScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "pkx/PK6.hpp"
#include "pkx/PK7.hpp"
#include "sav/Sav.hpp"
#include "utils/format.hpp"
#include <format>

namespace
Expand Down Expand Up @@ -2684,9 +2685,8 @@ void HexEditScreen::drawMeaning() const
100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0xF ... 0x10:
Gui::text(
std::vformat(i18n::localize("EDITOR_IDS"),
std::make_format_args(pkm.formatTID(), pkm.formatSID(), pkm.TSV())),
Gui::text(pksm::format(i18n::localize("EDITOR_IDS"), pkm.formatTID(),
pkm.formatSID(), pkm.TSV()),
160, 100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
}
Expand All @@ -2710,9 +2710,8 @@ void HexEditScreen::drawMeaning() const
100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0x9:
Gui::text(
std::vformat(i18n::localize("EDITOR_IDS"),
std::make_format_args(pkm.formatTID(), pkm.formatSID(), pkm.TSV())),
Gui::text(pksm::format(i18n::localize("EDITOR_IDS"), pkm.formatTID(),
pkm.formatSID(), pkm.TSV()),
160, 100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0x21:
Expand All @@ -2725,9 +2724,8 @@ void HexEditScreen::drawMeaning() const
switch (i)
{
case 0x4 ... 0x7:
Gui::text(
std::vformat(i18n::localize("EDITOR_IDS"),
std::make_format_args(pkm.formatTID(), pkm.formatSID(), pkm.TSV())),
Gui::text(pksm::format(i18n::localize("EDITOR_IDS"), pkm.formatTID(),
pkm.formatSID(), pkm.TSV()),
160, 100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0x8 ... 0x11:
Expand Down Expand Up @@ -2777,9 +2775,8 @@ void HexEditScreen::drawMeaning() const
160, 100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0xC ... 0xF:
Gui::text(
std::vformat(i18n::localize("EDITOR_IDS"),
std::make_format_args(pkm.formatTID(), pkm.formatSID(), pkm.TSV())),
Gui::text(pksm::format(i18n::localize("EDITOR_IDS"), pkm.formatTID(),
pkm.formatSID(), pkm.TSV()),
160, 100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0x15:
Expand Down Expand Up @@ -2837,9 +2834,8 @@ void HexEditScreen::drawMeaning() const
160, 100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0xC ... 0xF:
Gui::text(
std::vformat(i18n::localize("EDITOR_IDS"),
std::make_format_args(pkm.formatTID(), pkm.formatSID(), pkm.TSV())),
Gui::text(pksm::format(i18n::localize("EDITOR_IDS"), pkm.formatTID(),
pkm.formatSID(), pkm.TSV()),
160, 100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0x14:
Expand Down Expand Up @@ -2986,9 +2982,8 @@ void HexEditScreen::drawMeaning() const
160, 100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0xC ... 0xF:
Gui::text(
std::vformat(i18n::localize("EDITOR_IDS"),
std::make_format_args(pkm.formatTID(), pkm.formatSID(), pkm.TSV())),
Gui::text(pksm::format(i18n::localize("EDITOR_IDS"), pkm.formatTID(),
pkm.formatSID(), pkm.TSV()),
160, 100, FONT_SIZE_12, COLOR_WHITE, TextPosX::CENTER, TextPosY::TOP);
break;
case 0x14 ... 0x15:
Expand Down
Loading

0 comments on commit d896875

Please sign in to comment.