mirror of https://github.com/zeldaret/botw.git
clang-format
This commit is contained in:
parent
596d0798ae
commit
3c5bafd5d6
|
@ -17,6 +17,7 @@ public:
|
||||||
ArcResource() = default;
|
ArcResource() = default;
|
||||||
|
|
||||||
void init(ArcResourceMgr* mgr, const sead::SafeString& name, u8* data, res::Handle* handle);
|
void init(ArcResourceMgr* mgr, const sead::SafeString& name, u8* data, res::Handle* handle);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void* _20;
|
void* _20;
|
||||||
void* _28;
|
void* _28;
|
||||||
|
@ -28,5 +29,5 @@ private:
|
||||||
};
|
};
|
||||||
KSYS_CHECK_SIZE_NX150(ArcResource, 0xA8);
|
KSYS_CHECK_SIZE_NX150(ArcResource, 0xA8);
|
||||||
|
|
||||||
}
|
} // namespace ui
|
||||||
}
|
} // namespace ksys
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
#include <container/seadTList.h>
|
#include <container/seadTList.h>
|
||||||
#include <prim/seadSafeString.h>
|
#include <prim/seadSafeString.h>
|
||||||
#include "KingSystem/Utils/Types.h"
|
|
||||||
#include "KingSystem/System/UI/ArcResource.h"
|
#include "KingSystem/System/UI/ArcResource.h"
|
||||||
|
#include "KingSystem/Utils/Types.h"
|
||||||
|
|
||||||
namespace sead {
|
namespace sead {
|
||||||
class ExpHeap;
|
class ExpHeap;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#include <prim/seadScopedLock.h>
|
|
||||||
#include <devenv/seadEnvUtil.h>
|
#include <devenv/seadEnvUtil.h>
|
||||||
|
#include <prim/seadScopedLock.h>
|
||||||
|
|
||||||
#include "KingSystem/Resource/resLoadRequest.h"
|
#include "KingSystem/Resource/resLoadRequest.h"
|
||||||
#include "KingSystem/System/StarterPackMgr.h"
|
#include "KingSystem/System/StarterPackMgr.h"
|
||||||
|
@ -76,8 +76,13 @@ void LayoutResourceMgr::loadLangFont(sead::Heap* heap) {
|
||||||
|
|
||||||
constexpr const char* cExtraFontFiles[3][4] = {
|
constexpr const char* cExtraFontFiles[3][4] = {
|
||||||
{"AsiaKCUBE-R", "AsiaKDREAM2R", "AsiaKDREAM4R", "AsiaKDREAM7R"},
|
{"AsiaKCUBE-R", "AsiaKDREAM2R", "AsiaKDREAM4R", "AsiaKDREAM7R"},
|
||||||
{"DFP_GBZY9", "DFP_GB_H3", "DFP_GB_H5", "DFHEI5A", },
|
{
|
||||||
{ "DFT_ZY9", "DFT_B3", "DFT_B5", "DFT_B9"}};
|
"DFP_GBZY9",
|
||||||
|
"DFP_GB_H3",
|
||||||
|
"DFP_GB_H5",
|
||||||
|
"DFHEI5A",
|
||||||
|
},
|
||||||
|
{"DFT_ZY9", "DFT_B3", "DFT_B5", "DFT_B9"}};
|
||||||
|
|
||||||
void LayoutResourceMgr::loadExtraLangFonts(sead::Heap* heap) {
|
void LayoutResourceMgr::loadExtraLangFonts(sead::Heap* heap) {
|
||||||
sead::RegionLanguageID lang_id = sead::EnvUtil::getRegionLanguage();
|
sead::RegionLanguageID lang_id = sead::EnvUtil::getRegionLanguage();
|
||||||
|
@ -155,8 +160,8 @@ bool LayoutResourceMgr::checkVersionReady() {
|
||||||
}
|
}
|
||||||
if (mVersionHandle->isReady()) {
|
if (mVersionHandle->isReady()) {
|
||||||
auto* resource = sead::DynamicCast<sead::DirectResource>(mVersionHandle->getResource());
|
auto* resource = sead::DynamicCast<sead::DirectResource>(mVersionHandle->getResource());
|
||||||
instance()->mVersionString
|
instance()->mVersionString.copy(reinterpret_cast<const char*>(resource->getRawData()),
|
||||||
.copy(reinterpret_cast<const char*>(resource->getRawData()), static_cast<s32>(resource->getRawSize()));
|
static_cast<s32>(resource->getRawSize()));
|
||||||
delete mVersionHandle;
|
delete mVersionHandle;
|
||||||
mVersionHandle = nullptr;
|
mVersionHandle = nullptr;
|
||||||
return true;
|
return true;
|
||||||
|
@ -198,14 +203,14 @@ bool LayoutResourceMgr::loadHorseLayout(sead::Heap* heap) {
|
||||||
}
|
}
|
||||||
|
|
||||||
mHorseLayout.allocate(heap);
|
mHorseLayout.allocate(heap);
|
||||||
|
|
||||||
res::LoadRequest req;
|
res::LoadRequest req;
|
||||||
req.mRequester = "ui::LayoutResourceMgr";
|
req.mRequester = "ui::LayoutResourceMgr";
|
||||||
req.mLoadDataAlignment = 0x1000;
|
req.mLoadDataAlignment = 0x1000;
|
||||||
req._22 = false;
|
req._22 = false;
|
||||||
req._26 = true;
|
req._26 = true;
|
||||||
req._c = 2;
|
req._c = 2;
|
||||||
|
|
||||||
res::Handle::Status status = res::Handle::Status::NoFile;
|
res::Handle::Status status = res::Handle::Status::NoFile;
|
||||||
mHorseLayout.getHandle()->requestLoad("Layout/Horse.blarc", &req, &status);
|
mHorseLayout.getHandle()->requestLoad("Layout/Horse.blarc", &req, &status);
|
||||||
|
|
||||||
|
@ -218,10 +223,10 @@ bool LayoutResourceMgr::loadHorseLayoutResource() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LayoutResourceMgr::hasHorseLayoutLoadFailure() const {
|
bool LayoutResourceMgr::hasHorseLayoutLoadFailure() const {
|
||||||
if (mHorseLayout.getHandle()) {
|
if (mHorseLayout.getHandle()) {
|
||||||
if (mHorseLayout.getHandle()->isReady() && !mHorseLayout.getHandle()->isSuccess()) {
|
if (mHorseLayout.getHandle()->isReady() && !mHorseLayout.getHandle()->isSuccess()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -229,7 +234,7 @@ bool LayoutResourceMgr::hasHorseLayoutLoadFailure() const {
|
||||||
bool LayoutResourceMgr::unloadHorseLayout() {
|
bool LayoutResourceMgr::unloadHorseLayout() {
|
||||||
sead::ScopedLock<sead::CriticalSection> lock(&mCriticalSection);
|
sead::ScopedLock<sead::CriticalSection> lock(&mCriticalSection);
|
||||||
int old_count = mHorseLayoutLoadCount--;
|
int old_count = mHorseLayoutLoadCount--;
|
||||||
|
|
||||||
if (mHorseLayoutLoadCount == 0) {
|
if (mHorseLayoutLoadCount == 0) {
|
||||||
mHorseLayout.deallocate();
|
mHorseLayout.deallocate();
|
||||||
return true;
|
return true;
|
||||||
|
@ -244,7 +249,8 @@ bool LayoutResourceMgr::loadArcResource(Archive& archive, const char* name) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (archive.getHandle()->isSuccess()) {
|
if (archive.getHandle()->isSuccess()) {
|
||||||
auto* resource = sead::DynamicCast<sead::DirectResource>(archive.getHandle()->getResource());
|
auto* resource =
|
||||||
|
sead::DynamicCast<sead::DirectResource>(archive.getHandle()->getResource());
|
||||||
if (resource) {
|
if (resource) {
|
||||||
auto* arc_resource = reinterpret_cast<ArcResource*>(archive.mResourceStorage);
|
auto* arc_resource = reinterpret_cast<ArcResource*>(archive.mResourceStorage);
|
||||||
arc_resource->init(mArcResourceMgr, name, resource->getRawData(), archive.mHandle);
|
arc_resource->init(mArcResourceMgr, name, resource->getRawData(), archive.mHandle);
|
||||||
|
@ -256,10 +262,8 @@ bool LayoutResourceMgr::loadArcResource(Archive& archive, const char* name) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LayoutResourceMgr::unloadA8() {
|
void LayoutResourceMgr::unloadA8() {
|
||||||
_a8.deallocate();
|
_a8.deallocate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace ksys::ui
|
} // namespace ksys::ui
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
#include <prim/seadSafeString.h>
|
#include <prim/seadSafeString.h>
|
||||||
#include <thread/seadCriticalSection.h>
|
#include <thread/seadCriticalSection.h>
|
||||||
#include "KingSystem/Resource/resHandle.h"
|
#include "KingSystem/Resource/resHandle.h"
|
||||||
#include "KingSystem/Utils/Types.h"
|
|
||||||
#include "KingSystem/System/UI/ArcResourceMgr.h"
|
|
||||||
#include "KingSystem/System/UI/ArcResource.h"
|
#include "KingSystem/System/UI/ArcResource.h"
|
||||||
|
#include "KingSystem/System/UI/ArcResourceMgr.h"
|
||||||
|
#include "KingSystem/Utils/Types.h"
|
||||||
|
|
||||||
namespace nn::pl {
|
namespace nn::pl {
|
||||||
enum SharedFontType : int { Unknown = 0 };
|
enum SharedFontType : int { Unknown = 0 };
|
||||||
|
@ -17,11 +17,11 @@ u32 GetSharedFontLoadState(nn::pl::SharedFontType type);
|
||||||
#include "prim/seadEnum.h"
|
#include "prim/seadEnum.h"
|
||||||
namespace sead {
|
namespace sead {
|
||||||
SEAD_ENUM(RegionID, JP, US, EU, KR, CN)
|
SEAD_ENUM(RegionID, JP, US, EU, KR, CN)
|
||||||
class EnvUtil2 {
|
class EnvUtil2 {
|
||||||
public:
|
public:
|
||||||
static RegionID getRegion();
|
static RegionID getRegion();
|
||||||
};
|
};
|
||||||
}
|
} // namespace sead
|
||||||
|
|
||||||
namespace ksys::ui {
|
namespace ksys::ui {
|
||||||
|
|
||||||
|
@ -29,9 +29,11 @@ class LayoutResourceMgr {
|
||||||
SEAD_SINGLETON_DISPOSER(LayoutResourceMgr)
|
SEAD_SINGLETON_DISPOSER(LayoutResourceMgr)
|
||||||
LayoutResourceMgr() = default;
|
LayoutResourceMgr() = default;
|
||||||
~LayoutResourceMgr() = default;
|
~LayoutResourceMgr() = default;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Archive {
|
class Archive {
|
||||||
friend class LayoutResourceMgr;
|
friend class LayoutResourceMgr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void allocate(sead::Heap* heap) {
|
void allocate(sead::Heap* heap) {
|
||||||
mHandle = new (heap) res::Handle;
|
mHandle = new (heap) res::Handle;
|
||||||
|
@ -61,7 +63,6 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
virtual void this_class_has_vtable();
|
virtual void this_class_has_vtable();
|
||||||
|
|
||||||
void init(sead::Heap* heap);
|
void init(sead::Heap* heap);
|
||||||
|
|
Loading…
Reference in New Issue