mirror of
https://github.com/zeldaret/botw
synced 2026-06-06 19:41:34 -04:00
ksys/res: Implement register/unregisterFactory
This commit is contained in:
@@ -150,6 +150,17 @@ f32 ResourceMgrTask::getDefragProgress() const {
|
||||
return f32(_4cc) / f32(_4c8);
|
||||
}
|
||||
|
||||
void ResourceMgrTask::registerFactory(sead::ResourceFactory* factory,
|
||||
const sead::SafeString& name) {
|
||||
auto lock = sead::makeScopedLock(mFactoryCS);
|
||||
sead::ResourceMgr::instance()->registerFactory(factory, name);
|
||||
}
|
||||
|
||||
void ResourceMgrTask::unregisterFactory(sead::ResourceFactory* factory) {
|
||||
auto lock = sead::makeScopedLock(mFactoryCS);
|
||||
sead::ResourceMgr::instance()->unregisterFactory(factory);
|
||||
}
|
||||
|
||||
void ResourceMgrTask::cancelTasks() {
|
||||
stubbedLogFunction();
|
||||
stubbedLogFunction();
|
||||
|
||||
@@ -123,6 +123,9 @@ public:
|
||||
bool isDefragDone() const;
|
||||
f32 getDefragProgress() const;
|
||||
|
||||
void registerFactory(sead::ResourceFactory* factory, const sead::SafeString& name);
|
||||
void unregisterFactory(sead::ResourceFactory* factory);
|
||||
|
||||
s32 getCacheIdx(const sead::SafeString& path) const;
|
||||
|
||||
void cancelTasks();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "KingSystem/Resource/resSystem.h"
|
||||
#include "KingSystem/Resource/resEntryFactory.h"
|
||||
#include "KingSystem/Resource/resResourceMgrTask.h"
|
||||
|
||||
namespace ksys::res {
|
||||
@@ -7,6 +8,14 @@ bool stubbedLogFunction() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void registerEntryFactory(EntryFactoryBase* factory, const sead::SafeString& name) {
|
||||
ResourceMgrTask::instance()->registerFactory(factory, name);
|
||||
}
|
||||
|
||||
void unregisterEntryFactory(EntryFactoryBase* factory) {
|
||||
ResourceMgrTask::instance()->unregisterFactory(factory);
|
||||
}
|
||||
|
||||
bool isHostPath(const sead::SafeString& path) {
|
||||
return ResourceMgrTask::instance()->isHostPath(path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user