Skip to content

Commit

Permalink
LayoutResourceMgr part in ksys::PreInit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pistonight committed Aug 8, 2024
1 parent 181a709 commit 62f972d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/uking_functions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -81790,7 +81790,7 @@ Address,Quality,Size,Name
0x0000007100f3a528,U,000016,
0x0000007100f3a538,U,000756,ui::init
0x0000007100f3a82c,U,000172,createRegionLanguageMgr
0x0000007100f3a8d8,U,002276,ksys::PreInitializeApp
0x0000007100f3a8d8,W,002276,_ZN4ksys16preInitializeAppEPNS_10InitParamsE
0x0000007100f3b1bc,U,000132,checkPreInitializeResourcesStillLoading
0x0000007100f3b240,U,007612,ksys::InitializeApp
0x0000007100f3cffc,O,000388,_ZN4ksys15initBaseProcMgrEPN4sead4HeapE
Expand Down
20 changes: 20 additions & 0 deletions src/KingSystem/ksys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
#include "KingSystem/ActorSystem/actBaseProcCreateTaskSelector.h"
#include "KingSystem/ActorSystem/actBaseProcInitializer.h"
#include "KingSystem/ActorSystem/actBaseProcMgr.h"
#include "KingSystem/System/BasicProfiler.h"
#include "KingSystem/System/HavokWorkerMgr.h"
#include "KingSystem/System/UI/LayoutResourceMgr.h"

namespace ksys {

Expand All @@ -29,4 +31,22 @@ void initBaseProcMgr(sead::Heap* heap) {
act::BaseProcMgr::sConstant4 = u32(act::JobType::Calc4);
}

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);
ui::LayoutResourceMgr::instance()->init(params->king_sys_heap);
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");
}

} // namespace ksys
7 changes: 7 additions & 0 deletions src/KingSystem/ksys.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ class Heap;

namespace ksys {

struct InitParams {
sead::Heap* king_sys_heap;
};

// 0x0000007100f3a4e4
bool isGameOver();
// 0x0000007100f3a4f0
void setIsGameOver(bool is_game_over);

void initBaseProcMgr(sead::Heap* heap);

// 0x0000007100f3a8d8
void preInitializeApp(InitParams* params);

} // namespace ksys

0 comments on commit 62f972d

Please sign in to comment.