clang-format

This commit is contained in:
Pistonight 2024-08-08 23:41:57 -07:00
parent 596d0798ae
commit 3c5bafd5d6
4 changed files with 29 additions and 23 deletions

View File

@ -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

View File

@ -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;

View File

@ -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,7 +76,12 @@ 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", }, {
"DFP_GBZY9",
"DFP_GB_H3",
"DFP_GB_H5",
"DFHEI5A",
},
{"DFT_ZY9", "DFT_B3", "DFT_B5", "DFT_B9"}}; {"DFT_ZY9", "DFT_B3", "DFT_B5", "DFT_B9"}};
void LayoutResourceMgr::loadExtraLangFonts(sead::Heap* heap) { void LayoutResourceMgr::loadExtraLangFonts(sead::Heap* heap) {
@ -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;
@ -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

View File

@ -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 };
@ -21,7 +21,7 @@ SEAD_ENUM(RegionID, JP, US, EU, KR, CN)
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);