2012-12-09 17:49:28 +00:00
|
|
|
#ifndef _PAYSAGES_TERRAIN_PRIVATE_H_
|
|
|
|
#define _PAYSAGES_TERRAIN_PRIVATE_H_
|
|
|
|
|
2012-12-10 22:05:53 +00:00
|
|
|
#include "public.h"
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2013-02-07 16:06:26 +00:00
|
|
|
int xstart;
|
|
|
|
int xend;
|
|
|
|
int xsize;
|
|
|
|
int zstart;
|
|
|
|
int zend;
|
|
|
|
int zsize;
|
|
|
|
} IntegerRect;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
IntegerRect rect;
|
2013-01-10 15:41:14 +00:00
|
|
|
double* data;
|
2013-01-14 13:28:42 +00:00
|
|
|
} TerrainHeightMapChunk;
|
2012-12-10 22:05:53 +00:00
|
|
|
|
2013-01-10 15:41:14 +00:00
|
|
|
struct TerrainHeightMap
|
2012-12-10 22:05:53 +00:00
|
|
|
{
|
2013-01-14 13:28:42 +00:00
|
|
|
TerrainDefinition* terrain;
|
2012-12-10 22:05:53 +00:00
|
|
|
int fixed_count;
|
2013-01-14 13:28:42 +00:00
|
|
|
TerrainHeightMapChunk* fixed_data;
|
2013-01-10 15:41:14 +00:00
|
|
|
int floating_used;
|
2013-01-14 13:28:42 +00:00
|
|
|
TerrainHeightMapChunk floating_data;
|
2013-01-10 15:41:14 +00:00
|
|
|
};
|
2012-12-10 22:05:53 +00:00
|
|
|
|
2013-01-14 13:28:42 +00:00
|
|
|
TerrainHeightMap* terrainHeightMapCreate(TerrainDefinition* definition);
|
2013-01-10 21:21:56 +00:00
|
|
|
void terrainHeightmapDelete(TerrainHeightMap* heightmap);
|
|
|
|
void terrainHeightmapCopy(TerrainHeightMap* source, TerrainHeightMap* destination);
|
|
|
|
void terrainHeightmapSave(PackStream* stream, TerrainHeightMap* heightmap);
|
|
|
|
void terrainHeightmapLoad(PackStream* stream, TerrainHeightMap* heightmap);
|
2013-01-14 12:08:38 +00:00
|
|
|
int terrainHeightmapGetHeight(TerrainHeightMap* heightmap, double x, double z, double* result);
|
2013-01-10 21:21:56 +00:00
|
|
|
|
2012-12-09 17:49:28 +00:00
|
|
|
#endif
|