From 3ff5c64f9ddd2cb0dd3b2e1830b6ad26823c6bf6 Mon Sep 17 00:00:00 2001 From: Pistonight Date: Wed, 7 Aug 2024 23:00:47 -0700 Subject: [PATCH] clang-format --- src/KingSystem/System/UI/ArcResourceMgr.h | 3 +- .../System/UI/LayoutResourceMgr.cpp | 48 +++++++------------ src/KingSystem/System/UI/LayoutResourceMgr.h | 11 ++--- src/KingSystem/ksys.cpp | 6 +-- 4 files changed, 27 insertions(+), 41 deletions(-) diff --git a/src/KingSystem/System/UI/ArcResourceMgr.h b/src/KingSystem/System/UI/ArcResourceMgr.h index 247055ef..06907912 100644 --- a/src/KingSystem/System/UI/ArcResourceMgr.h +++ b/src/KingSystem/System/UI/ArcResourceMgr.h @@ -9,6 +9,7 @@ class ArcResourceMgr { public: ArcResourceMgr() = default; virtual ~ArcResourceMgr(); + private: // TODO: fields /* sead::TList */ @@ -18,4 +19,4 @@ class ArcResourceMgr { }; KSYS_CHECK_SIZE_NX150(ArcResourceMgr, 0x20); -} +} // namespace ksys::ui diff --git a/src/KingSystem/System/UI/LayoutResourceMgr.cpp b/src/KingSystem/System/UI/LayoutResourceMgr.cpp index 983b8b21..1dd667b2 100644 --- a/src/KingSystem/System/UI/LayoutResourceMgr.cpp +++ b/src/KingSystem/System/UI/LayoutResourceMgr.cpp @@ -17,14 +17,14 @@ void LayoutResourceMgr::init(sead::Heap* heap) { int count; // value() needed because operator int() is volatile switch (sead::EnvUtil::getRegionLanguage().value()) { - case sead::RegionLanguageID::KRko: - case sead::RegionLanguageID::CNzh: - case sead::RegionLanguageID::TWzh: - count = 4; - break; - default: - count = 0; - break; + case sead::RegionLanguageID::KRko: + case sead::RegionLanguageID::CNzh: + case sead::RegionLanguageID::TWzh: + count = 4; + break; + default: + count = 0; + break; } for (int i = 0; i < count; i++) { mExtraLangFontHandles.pushBack(new (heap) res::Handle); @@ -50,9 +50,8 @@ u8* LayoutResourceMgr::loadMsgPack(u32* size) { path.format("Message/Msg_%s.product.sarc", sead::EnvUtil::getRegionLanguage().text()); res::Handle::Status status; - auto* resource = sead::DynamicCast( - mMsgPackHandle->load(path, &req, &status) - ); + auto* resource = + sead::DynamicCast(mMsgPackHandle->load(path, &req, &status)); *size = resource->getRawSize(); return resource->getRawData(); @@ -77,19 +76,8 @@ void LayoutResourceMgr::loadLangFont(sead::Heap* heap) { } constexpr const char* cExtraFontFiles[12] = { - "AsiaKCUBE-R", - "AsiaKDREAM2R", - "AsiaKDREAM4R", - "AsiaKDREAM7R", - "DFP_GBZY9", - "DFP_GB_H3", - "DFP_GB_H5", - "DFHEI5A", - "DFT_ZY9", - "DFT_B3", - "DFT_B5", - "DFT_B9" -}; + "AsiaKCUBE-R", "AsiaKDREAM2R", "AsiaKDREAM4R", "AsiaKDREAM7R", "DFP_GBZY9", "DFP_GB_H3", + "DFP_GB_H5", "DFHEI5A", "DFT_ZY9", "DFT_B3", "DFT_B5", "DFT_B9"}; void LayoutResourceMgr::loadExtraLangFonts(sead::Heap* heap) { sead::RegionLanguageID lang_id = sead::EnvUtil::getRegionLanguage(); @@ -133,12 +121,12 @@ bool LayoutResourceMgr::checkLangFontReady() { bool LayoutResourceMgr::checkExtraLangFontsReady() const { switch (sead::EnvUtil::getRegionLanguage().value()) { - case sead::RegionLanguageID::KRko: - case sead::RegionLanguageID::CNzh: - case sead::RegionLanguageID::TWzh: - break; - default: - return true; + case sead::RegionLanguageID::KRko: + case sead::RegionLanguageID::CNzh: + case sead::RegionLanguageID::TWzh: + break; + default: + return true; } for (const auto& handle : mExtraLangFontHandles) { if (!handle.isReady()) { diff --git a/src/KingSystem/System/UI/LayoutResourceMgr.h b/src/KingSystem/System/UI/LayoutResourceMgr.h index a98de6d4..838f2d3e 100644 --- a/src/KingSystem/System/UI/LayoutResourceMgr.h +++ b/src/KingSystem/System/UI/LayoutResourceMgr.h @@ -1,21 +1,19 @@ #pragma once +#include #include #include #include -#include #include "KingSystem/Resource/resHandle.h" #include "KingSystem/Utils/Types.h" #include "ArcResourceMgr.h" namespace nn::pl { -enum SharedFontType : int { - Unknown = 0 -}; +enum SharedFontType : int { Unknown = 0 }; u64 RequestSharedFontLoad(nn::pl::SharedFontType type); u32 GetSharedFontLoadState(nn::pl::SharedFontType type); -} +} // namespace nn::pl namespace ksys::ui { @@ -25,7 +23,6 @@ class LayoutResourceMgr { virtual ~LayoutResourceMgr(); public: - void init(sead::Heap* heap); u8* loadMsgPack(u32* size); void loadLangFont(sead::Heap* heap); @@ -58,4 +55,4 @@ class LayoutResourceMgr { }; KSYS_CHECK_SIZE_NX150(LayoutResourceMgr, 0x168); -} +} // namespace ksys::ui diff --git a/src/KingSystem/ksys.cpp b/src/KingSystem/ksys.cpp index f8504889..de4c6bdd 100644 --- a/src/KingSystem/ksys.cpp +++ b/src/KingSystem/ksys.cpp @@ -35,7 +35,7 @@ void preInitializeApp(InitParams* params) { ksys::BasicProfiler::push("ksys::PreInitializeApp"); // TODO - other parts - + ksys::BasicProfiler::push("RequestFontLoad"); // TODO: FontMgr::createInstance() ui::LayoutResourceMgr::createInstance(params->king_sys_heap); @@ -43,9 +43,9 @@ void preInitializeApp(InitParams* params) { ui::LayoutResourceMgr::instance()->loadLangFont(params->king_sys_heap); ui::LayoutResourceMgr::instance()->loadExtraLangFonts(params->king_sys_heap); ksys::BasicProfiler::pop("RequestFontLoad"); - + // TODO - other parts - + ksys::BasicProfiler::pop("ksys::PreInitializeApp"); }