summaryrefslogtreecommitdiff
path: root/terrain_loader.h
blob: f99fb09d000e19600a4ac88c0c39147a57c95e8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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