1
0

The subgenerators use cChunkDesc instead of raw arrays. cChunkDesc is based on cBlockArea. Initial version of Lakes generator.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1286 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-03-19 08:32:02 +00:00
parent 1c1bcf5c07
commit b4697ab9db
11 changed files with 324 additions and 171 deletions

View File

@@ -92,6 +92,70 @@ static void MergeCombinatorImprint(BLOCKTYPE & a_DstType, BLOCKTYPE a_SrcType, N
/// Combinator used for cBlockArea::msLake merging
static void MergeCombinatorLake(BLOCKTYPE & a_DstType, BLOCKTYPE a_SrcType, NIBBLETYPE & a_DstMeta, NIBBLETYPE a_SrcMeta)
{
// Sponge is the NOP block
if (a_SrcType == E_BLOCK_SPONGE)
{
return;
}
// Air is always hollowed out
if (a_SrcType == E_BLOCK_AIR)
{
a_DstType = E_BLOCK_AIR;
a_DstMeta = 0;
return;
}
// Water and lava are never overwritten
switch (a_DstType)
{
case E_BLOCK_WATER:
case E_BLOCK_STATIONARY_WATER:
case E_BLOCK_LAVA:
case E_BLOCK_STATIONARY_LAVA:
{
return;
}
}
// Water and lava always overwrite
switch (a_SrcType)
{
case E_BLOCK_WATER:
case E_BLOCK_STATIONARY_WATER:
case E_BLOCK_LAVA:
case E_BLOCK_STATIONARY_LAVA:
{
a_DstType = a_SrcType;
a_DstMeta = a_DstMeta;
return;
}
}
if (a_SrcType == E_BLOCK_STONE)
{
switch (a_DstType)
{
case E_BLOCK_DIRT:
case E_BLOCK_GRASS:
case E_BLOCK_MYCELIUM:
{
a_DstType = E_BLOCK_STONE;
a_DstMeta = 0;
return;
}
}
}
// Everything else is left as it is
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cBlockArea:
@@ -611,6 +675,21 @@ void cBlockArea::Merge(const cBlockArea & a_Src, int a_RelX, int a_RelY, int a_R
break;
} // case msImprint
case msLake:
{
InternalMergeBlocks(
m_BlockTypes, a_Src.GetBlockTypes(),
DstMetas, SrcMetas,
SizeX, SizeY, SizeZ,
SrcOffX, SrcOffY, SrcOffZ,
DstOffX, DstOffY, DstOffZ,
a_Src.GetSizeX(), a_Src.GetSizeY(), a_Src.GetSizeZ(),
m_SizeX, m_SizeY, m_SizeZ,
MergeCombinatorLake
);
break;
} // case msLake
default:
{
LOGWARNING("Unknown block area merge strategy: %d", a_Strategy);