summaryrefslogtreecommitdiff
path: root/src/worldmap.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/worldmap.h65
1 files changed, 10 insertions, 55 deletions
diff --git a/src/worldmap.h b/src/worldmap.h
index ea1cd93..8ea7e4c 100644
--- a/src/worldmap.h
+++ b/src/worldmap.h
@@ -8,15 +8,19 @@
// TODO: add Save Error state
+#ifndef __NEWER_WORLDMAP_H
+#define __NEWER_WORLDMAP_H
+
#define WM_DEBUGGING
#include <common.h>
#include <game.h>
+#include <g3dhax.h>
#include "fileload.h"
#include "levelinfo.h"
#include "worldmapdata.h"
-#include <g3dhax.h>
+#include "wmresourcemng.h"
enum WMDirection {
LEFT,
@@ -34,57 +38,6 @@ inline void MapReport(const char *str, ...) { }
void NewerMapDrawFunc();
-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;
- }
-};
class dWMMap_c : public dBase_c {
@@ -149,8 +102,8 @@ public:
void *stockItemShadow;
void *easyPairing;
- void *levelInfo;
- FileHandle levelInfoFH;
+ File levelInfoFile;
+ LevelInfo levelInfo;
dWMResourceMng_c resMng;
@@ -182,7 +135,7 @@ public:
void ActivatePoint();
- void StartLevel(LevelInfo_Entry *entry);
+ void StartLevel(LevelInfo::Entry *entry);
int onCreate();
int onDelete();
@@ -193,3 +146,5 @@ public:
static dScNewerWorldMap_c *instance;
};
+#endif
+