Ejemplo n.º 1
0
/**
 * Add foundation bits from the bottom up to the given voxel.
 * @param world %Voxel storage.
 * @param xpos X position of the voxel stack.
 * @param ypos Y position of the voxel stack.
 * @param z Height of the ground.
 * @param bits Foundation bits to add.
 */
static void AddFoundations(VoxelWorld *world, uint16 xpos, uint16 ypos, int16 z, uint8 bits)
{
	for (int16 zpos = 0; zpos < z; zpos++) {
		Voxel *v = world->GetCreateVoxel(XYZPoint16(xpos, ypos, zpos), true);
		if (v->GetFoundationType() == FDT_INVALID) {
			v->SetFoundationType(FDT_GROUND);
			v->SetFoundationSlope(bits);
			continue;
		}
		v->SetFoundationSlope(v->GetFoundationSlope() | bits);
	}
}