ksys/res: Implement EntryFactory (base class and template)

Also adds a heap-related function that's used by EntryFactory
(and many other functions)
This commit is contained in:
Léo Lam
2020-09-04 22:01:52 +02:00
parent 578955f4e9
commit 3d371999a4
8 changed files with 127 additions and 16 deletions
@@ -0,0 +1,20 @@
#include "KingSystem/Resource/resEntryFactory.h"
namespace ksys::res {
static EntryFactory<Resource> sDefaultEntryFactory;
u32 EntryFactoryBase::getResourceSize() const {
KSYS_CHECK_SIZE_NX150(sead::DirectResource, 0x20);
return sizeof(sead::DirectResource);
}
u32 EntryFactoryBase::getLoadDataAlignment() const {
return sizeof(void*);
}
EntryFactory<Resource>& getDefaultResourceFactory() {
return sDefaultEntryFactory;
}
} // namespace ksys::res