summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-02-20 17:16:37 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-02-20 17:16:37 +0000
commit38a97bac830d6afe82fe3f68f3d8a0831bb5b643 (patch)
treeae8f26697caeee74da81c7b87cda0ac90faf5fb7 /src/resources/mapreader.h
parentd332272741e8382409453b975c66235d45e66cc7 (diff)
downloadmana-client-38a97bac830d6afe82fe3f68f3d8a0831bb5b643.tar.gz
mana-client-38a97bac830d6afe82fe3f68f3d8a0831bb5b643.tar.bz2
mana-client-38a97bac830d6afe82fe3f68f3d8a0831bb5b643.tar.xz
mana-client-38a97bac830d6afe82fe3f68f3d8a0831bb5b643.zip
More progress towards loading XML maps.
Diffstat (limited to 'src/resources/mapreader.h')
-rw-r--r--src/resources/mapreader.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h
index d58fdf90..b2a076ec 100644
--- a/src/resources/mapreader.h
+++ b/src/resources/mapreader.h
@@ -25,8 +25,29 @@
#define _INCLUDED_MAPREADER_H
#include "../map.h"
+#include "../graphic/spriteset.h"
#include <libxml/parser.h>
#include <libxml/tree.h>
+#include <vector>
+
+/**
+ * A tileset, which is basically just a spriteset but it stores a firstgid.
+ */
+class Tileset : public Spriteset {
+ public:
+ /**
+ * Constructor.
+ */
+ Tileset(Image *img, int w, int h, int firstGid);
+
+ /**
+ * Returns the first gid.
+ */
+ int getFirstGid();
+
+ private:
+ int firstGid;
+};
/**
* Reader for XML map files (*.tmx)
@@ -54,10 +75,15 @@ class MapReader
/**
* Helper function that handles reading a tile set.
*/
- static void readTileset(xmlNodePtr node, const std::string &path,
+ static Tileset *readTileset(xmlNodePtr node, const std::string &path,
Map *map);
+ /**
+ * Helper function to get an integer property.
+ */
static int getProperty(xmlNodePtr node, const char* name, int def);
+
+ static std::vector<Tileset*> tilesets;
};
#endif