summaryrefslogtreecommitdiff
path: root/src/KingSystem/Resource/resEntryFactory.cpp
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2020-09-04 22:01:52 +0200
committerLéo Lam <leo@leolam.fr>2020-09-04 22:01:52 +0200
commit3d371999a4a7223637aaf6bd4428a046574609d8 (patch)
treeac09a44ef56c472fd0f55cf34c4242300d08eca2 /src/KingSystem/Resource/resEntryFactory.cpp
parent578955f4e9b0d352a6a9c70288d8e988a1ec2717 (diff)
ksys/res: Implement EntryFactory (base class and template)
Also adds a heap-related function that's used by EntryFactory (and many other functions)
Diffstat (limited to 'src/KingSystem/Resource/resEntryFactory.cpp')
-rw-r--r--src/KingSystem/Resource/resEntryFactory.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/KingSystem/Resource/resEntryFactory.cpp b/src/KingSystem/Resource/resEntryFactory.cpp
new file mode 100644
index 00000000..ac3a1a7e
--- /dev/null
+++ b/src/KingSystem/Resource/resEntryFactory.cpp
@@ -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