mirror of https://github.com/zeldaret/botw.git
clang-format
This commit is contained in:
parent
62f972da86
commit
3ff5c64f9d
|
@ -9,6 +9,7 @@ class ArcResourceMgr {
|
|||
public:
|
||||
ArcResourceMgr() = default;
|
||||
virtual ~ArcResourceMgr();
|
||||
|
||||
private:
|
||||
// TODO: fields
|
||||
/* sead::TList */
|
||||
|
@ -18,4 +19,4 @@ private:
|
|||
};
|
||||
KSYS_CHECK_SIZE_NX150(ArcResourceMgr, 0x20);
|
||||
|
||||
}
|
||||
} // namespace ksys::ui
|
||||
|
|
|
@ -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<sead::DirectResource>(
|
||||
mMsgPackHandle->load(path, &req, &status)
|
||||
);
|
||||
auto* resource =
|
||||
sead::DynamicCast<sead::DirectResource>(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()) {
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
#include <container/seadObjArray.h>
|
||||
#include <heap/seadDisposer.h>
|
||||
#include <prim/seadSafeString.h>
|
||||
#include <thread/seadCriticalSection.h>
|
||||
#include <container/seadObjArray.h>
|
||||
#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 @@ private:
|
|||
};
|
||||
KSYS_CHECK_SIZE_NX150(LayoutResourceMgr, 0x168);
|
||||
|
||||
}
|
||||
} // namespace ksys::ui
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue