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