summaryrefslogtreecommitdiff
path: root/src/wmresourcemng.h
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-03-13 23:35:44 +0100
committerTreeki <treeki@gmail.com>2011-03-13 23:35:44 +0100
commit793fc74bd957eea3930e30aae704e47adee5e015 (patch)
tree577e0579ef3de4e0a1063a94a7f3a4b144abcc33 /src/wmresourcemng.h
parent485c95c4fc071f954c7f808b0a89eb37d147c57b (diff)
downloadkamek-793fc74bd957eea3930e30aae704e47adee5e015.tar.gz
kamek-793fc74bd957eea3930e30aae704e47adee5e015.zip
made LevelInfo into an OO class and added a header file for dWMResourceMng_c
Diffstat (limited to '')
-rw-r--r--src/wmresourcemng.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/wmresourcemng.h b/src/wmresourcemng.h
new file mode 100644
index 0000000..910acf1
--- /dev/null
+++ b/src/wmresourcemng.h
@@ -0,0 +1,57 @@
+#ifndef __NEWER_WMRESOURCEMNG_H
+#define __NEWER_WMRESOURCEMNG_H
+
+struct WMResSetEntry {
+ u32 key;
+ u32 offset;
+};
+
+struct WMResSetHeader {
+ u32 magic;
+ u32 count;
+ WMResSetEntry entries[1]; // dynamic size
+
+ char *getName(int index) {
+ return (char*)((u32)this + entries[index].offset);
+ }
+};
+
+class dWMResourceMng_c {
+private:
+ bool hasSetPath;
+ bool isSetLoaded;
+ bool isLoadingComplete;
+
+ char setPath[0x40];
+ dDvdLoader_c setLoader;
+ dDvdLoader_c *resLoaders;
+
+ WMResSetHeader *setData;
+
+ void prepareResources();
+
+public:
+ dWMResourceMng_c();
+ ~dWMResourceMng_c();
+
+ bool loadSet(const char *setName);
+ void *operator[](u32 key);
+
+ bool isLoaded();
+
+
+ u32 resCount() {
+ return setData->count;
+ }
+
+ u32 keyForIndex(u32 index) {
+ return setData->entries[index].key;
+ }
+
+ void *dataForIndex(u32 index) {
+ return resLoaders[index].buffer;
+ }
+};
+
+#endif
+