1
0

Village houses are height-adjusted onto the terrain.

This commit is contained in:
madmaxoft
2014-05-17 21:54:04 +02:00
parent fc5c3abcba
commit 7004043c61
5 changed files with 67 additions and 7 deletions

View File

@@ -191,13 +191,21 @@ void cPrefab::AddRotatedBlockAreas(void)
void cPrefab::Draw(cChunkDesc & a_Dest, const cPlacedPiece * a_Placement) const
{
Draw(a_Dest, a_Placement->GetCoords(), a_Placement->GetNumCCWRotations());
}
void cPrefab::Draw(cChunkDesc & a_Dest, const Vector3i & a_Placement, int a_NumRotations) const
{
// Draw the basic image:
Vector3i Placement = a_Placement->GetCoords();
Vector3i Placement(a_Placement);
int ChunkStartX = a_Dest.GetChunkX() * cChunkDef::Width;
int ChunkStartZ = a_Dest.GetChunkZ() * cChunkDef::Width;
Placement.Move(-ChunkStartX, 0, -ChunkStartZ);
const cBlockArea & Image = m_BlockArea[a_Placement->GetNumCCWRotations()];
const cBlockArea & Image = m_BlockArea[a_NumRotations];
a_Dest.WriteBlockArea(Image, Placement.x, Placement.y, Placement.z, m_MergeStrategy);
// If requested, draw the floor (from the bottom of the prefab down to the nearest non-air)