From 1ed3b3aed2e538af2c3bffa41f54a30ac6535f12 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 17 Mar 2013 17:55:03 +0000 Subject: Rewritten generators so that they use the cChunkDesc class (and thus can use cBlockArea merging) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1282 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Generating/ChunkDesc.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'source/Generating/ChunkDesc.cpp') diff --git a/source/Generating/ChunkDesc.cpp b/source/Generating/ChunkDesc.cpp index f19c0ae1e..00ccacc07 100644 --- a/source/Generating/ChunkDesc.cpp +++ b/source/Generating/ChunkDesc.cpp @@ -39,6 +39,16 @@ cChunkDesc::~cChunkDesc() +void cChunkDesc::SetChunkCoords(int a_ChunkX, int a_ChunkZ) +{ + m_ChunkX = a_ChunkX; + m_ChunkZ = a_ChunkZ; +} + + + + + void cChunkDesc::FillBlocks(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { const NIBBLETYPE CompressedMeta = a_BlockMeta | (a_BlockMeta << 4); @@ -411,3 +421,19 @@ void cChunkDesc::ReadBlockArea(cBlockArea & a_Dest, int a_MinRelX, int a_MaxRelX +HEIGHTTYPE cChunkDesc::GetMaxHeight(void) const +{ + HEIGHTTYPE MaxHeight = m_HeightMap[0]; + for (int i = 1; i < ARRAYCOUNT(m_HeightMap); i++) + { + if (m_HeightMap[i] > MaxHeight) + { + MaxHeight = m_HeightMap[i]; + } + } + return MaxHeight; +} + + + + -- cgit v1.2.3