diff options
author | Mattes D <github@xoft.cz> | 2014-11-12 21:24:26 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-11-12 21:24:26 +0100 |
commit | 5fb2526e0739fa27d925a686669f2c3aef56e825 (patch) | |
tree | c548202392d5f2cf12ee7b23a45c9f0a9026d9c6 /src/Generating/ChunkDesc.h | |
parent | BiomalNoise3D: Added a few biomes. (diff) | |
download | cuberite-5fb2526e0739fa27d925a686669f2c3aef56e825.tar cuberite-5fb2526e0739fa27d925a686669f2c3aef56e825.tar.gz cuberite-5fb2526e0739fa27d925a686669f2c3aef56e825.tar.bz2 cuberite-5fb2526e0739fa27d925a686669f2c3aef56e825.tar.lz cuberite-5fb2526e0739fa27d925a686669f2c3aef56e825.tar.xz cuberite-5fb2526e0739fa27d925a686669f2c3aef56e825.tar.zst cuberite-5fb2526e0739fa27d925a686669f2c3aef56e825.zip |
Diffstat (limited to 'src/Generating/ChunkDesc.h')
-rw-r--r-- | src/Generating/ChunkDesc.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/src/Generating/ChunkDesc.h b/src/Generating/ChunkDesc.h index 570132790..b86041a7d 100644 --- a/src/Generating/ChunkDesc.h +++ b/src/Generating/ChunkDesc.h @@ -29,10 +29,17 @@ class cChunkDesc { public: // tolua_end + + /** The datatype used to represent the entire chunk worth of shape. + 0 = air + 1 = solid + Indexed as [y + 256 * z + 256 * 16 * x]. */ + typedef Byte Shape[256 * 16 * 16]; /** Uncompressed block metas, 1 meta per byte */ typedef NIBBLETYPE BlockNibbleBytes[cChunkDef::NumBlocks]; + cChunkDesc(int a_ChunkX, int a_ChunkZ); ~cChunkDesc(); @@ -57,10 +64,21 @@ public: EMCSBiome GetBiome(int a_RelX, int a_RelZ); // These operate on the heightmap, so they could get out of sync with the data - // Use UpdateHeightmap() to re-sync + // Use UpdateHeightmap() to re-calculate heightmap from the block data void SetHeight(int a_RelX, int a_RelZ, int a_Height); int GetHeight(int a_RelX, int a_RelZ); + // tolua_end + + /** Sets the heightmap to match the given shape data. + Note that this ignores overhangs; the method is mostly used by old composition generators. */ + void SetHeightFromShape(const Shape & a_Shape); + + /** Sets the shape in a_Shape to match the heightmap stored currently in m_HeightMap. */ + void GetShapeFromHeight(Shape & a_Shape) const; + + // tolua_begin + // Default generation: void SetUseDefaultBiomes(bool a_bUseDefaultBiomes); bool IsUsingDefaultBiomes(void) const; @@ -77,8 +95,11 @@ public: /** Reads an area from the chunk into a cBlockArea, blocktypes and blockmetas */ void ReadBlockArea(cBlockArea & a_Dest, int a_MinRelX, int a_MaxRelX, int a_MinRelY, int a_MaxRelY, int a_MinRelZ, int a_MaxRelZ); - /** Returns the maximum height value in the heightmap */ + /** Returns the maximum height value in the heightmap. */ HEIGHTTYPE GetMaxHeight(void) const; + + /** Returns the minimum height value in the heightmap. */ + HEIGHTTYPE GetMinHeight(void) const; /** Fills the relative cuboid with specified block; allows cuboid out of range of this chunk */ void FillRelCuboid( |