summaryrefslogtreecommitdiff
path: root/terrain_loader.h
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-06-01 19:02:52 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-06-01 19:02:52 +0200
commitdc104e37842049e040f7e39f4e1aab56cde1488c (patch)
tree7a2b98b1007fe7325752ae5a8e728d1410072dfb /terrain_loader.h
Moved common files here.
Diffstat (limited to 'terrain_loader.h')
-rw-r--r--terrain_loader.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/terrain_loader.h b/terrain_loader.h
new file mode 100644
index 0000000..f99fb09
--- /dev/null
+++ b/terrain_loader.h
@@ -0,0 +1,27 @@
+#ifndef TERRAIN_LOADER_H
+#define TERRAIN_LOADER_H
+
+#include <boost/filesystem.hpp>
+#include <boost/shared_ptr.hpp>
+
+namespace fs = boost::filesystem;
+
+class TerrainLoader {
+ private:
+ fs::path root;
+
+ public:
+ typedef boost::shared_ptr<TerrainLoader> p;
+
+ TerrainLoader(fs::path root);
+ virtual ~TerrainLoader();
+
+ float *generate_heights(int64_t x, int64_t y, unsigned int width, unsigned int height);
+ virtual float *get_chunk(int64_t x, int64_t y, unsigned int width, unsigned int height);
+ bool has_chunk(int64_t x, int64_t y);
+ void save_chunk(float *chunk, int64_t x, int64_t y, unsigned int width, unsigned int height);
+ float *load_chunk(int64_t x, int64_t y, unsigned int width, unsigned int height);
+
+};
+
+#endif