summaryrefslogtreecommitdiff
path: root/terrain.h
diff options
context:
space:
mode:
Diffstat (limited to 'terrain.h')
-rw-r--r--terrain.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/terrain.h b/terrain.h
index 6fa39b3..cca01b7 100644
--- a/terrain.h
+++ b/terrain.h
@@ -5,6 +5,7 @@
#include "terrain_cache.h"
#include <list>
+#include <queue>
class Terrain {
public:
@@ -30,8 +31,10 @@ class Terrain {
struct Chunk {
Terrain *terrain;
Node **nodes;
- float x, y, width, height;
+ float x, y;
+ int width, height;
int h_width, h_height;
+ int n_width, n_height;
float *heights;
TerrainCacheObject::p cache_obj;
Vector3 *normals;
@@ -40,8 +43,9 @@ class Terrain {
unsigned int node_count;
unsigned int vertices;
float init_time;
+ bool need_normals;
- Chunk(Terrain *tree, float x, float y, float width, float height);
+ Chunk(Terrain *tree, float x, float y);
~Chunk();
float distance(float px, float pz);
@@ -51,6 +55,8 @@ class Terrain {
};
static const int chunk_size = 32;
+ //! Chunk size with overhead.
+ static const int chunk_size_total = chunk_size + 3;
std::list<Chunk*> chunks;
TerrainCache *tc;