mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Merge e877bd6cf7
into 0ea89d4112
This commit is contained in:
commit
2bf3d06b91
10 changed files with 47 additions and 1 deletions
|
@ -769,6 +769,22 @@ void MapgenBasic::generateBiomes()
|
|||
}
|
||||
|
||||
|
||||
void MapgenBasic::removeOvergeneratedCStone()
|
||||
{
|
||||
for (s16 z = node_min.Z; z <= node_max.Z; z++)
|
||||
for (s16 x = node_min.X; x <= node_max.X; x++) {
|
||||
u32 vi = vm->m_area.index(x, node_max.Y + 1, z); // top
|
||||
if (vm->m_data[vi].getContent() == c_stone) {
|
||||
vm->m_data[vi].setContent(CONTENT_IGNORE);
|
||||
}
|
||||
vi = vm->m_area.index(x, node_min.Y - 1, z); // bottom
|
||||
if (vm->m_data[vi].getContent() == c_stone) {
|
||||
vm->m_data[vi].setContent(CONTENT_IGNORE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MapgenBasic::dustTopNodes()
|
||||
{
|
||||
if (node_max.Y < water_level)
|
||||
|
@ -955,7 +971,6 @@ void MapgenBasic::generateDungeons(s16 max_stone_y)
|
|||
dgen.generate(vm, blockseed, full_node_min, full_node_max);
|
||||
}
|
||||
|
||||
|
||||
////
|
||||
//// GenerateNotifier
|
||||
////
|
||||
|
|
|
@ -289,6 +289,7 @@ public:
|
|||
virtual void generateCavesRandomWalk(s16 max_stone_y, s16 large_cave_ymax);
|
||||
virtual bool generateCavernsNoise(s16 max_stone_y);
|
||||
virtual void generateDungeons(s16 max_stone_y);
|
||||
virtual void removeOvergeneratedCStone();
|
||||
|
||||
protected:
|
||||
BiomeManager *m_bmgr;
|
||||
|
|
|
@ -318,6 +318,8 @@ void MapgenCarpathian::makeChunk(BlockMakeData *data)
|
|||
full_node_min, full_node_max);
|
||||
}
|
||||
|
||||
removeOvergeneratedCStone();
|
||||
|
||||
this->generating = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -268,6 +268,8 @@ void MapgenFlat::makeChunk(BlockMakeData *data)
|
|||
//setLighting(node_min - v3s16(1, 0, 1) * MAP_BLOCKSIZE,
|
||||
// node_max + v3s16(1, 0, 1) * MAP_BLOCKSIZE, 0xFF);
|
||||
|
||||
removeOvergeneratedCStone();
|
||||
|
||||
this->generating = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -263,6 +263,8 @@ void MapgenFractal::makeChunk(BlockMakeData *data)
|
|||
calcLighting(node_min - v3s16(0, 1, 0), node_max + v3s16(0, 1, 0),
|
||||
full_node_min, full_node_max);
|
||||
|
||||
removeOvergeneratedCStone();
|
||||
|
||||
this->generating = false;
|
||||
|
||||
//printf("makeChunk: %lums\n", t.stop());
|
||||
|
|
|
@ -262,6 +262,8 @@ void MapgenV5::makeChunk(BlockMakeData *data)
|
|||
full_node_min, full_node_max);
|
||||
}
|
||||
|
||||
removeOvergeneratedCStone();
|
||||
|
||||
this->generating = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -620,10 +620,27 @@ void MapgenV6::makeChunk(BlockMakeData *data)
|
|||
calcLighting(node_min - v3s16(1, 1, 1) * MAP_BLOCKSIZE,
|
||||
node_max + v3s16(1, 0, 1) * MAP_BLOCKSIZE,
|
||||
full_node_min, full_node_max);
|
||||
|
||||
removeOvergeneratedCStone();
|
||||
|
||||
this->generating = false;
|
||||
}
|
||||
|
||||
void MapgenV6::removeOvergeneratedCStone()
|
||||
{
|
||||
for (s16 z = node_min.Z; z <= node_max.Z; z++)
|
||||
for (s16 x = node_min.X; x <= node_max.X; x++) {
|
||||
u32 vi = vm->m_area.index(x, node_max.Y + 1, z); // top
|
||||
if (vm->m_data[vi].getContent() == c_stone) {
|
||||
vm->m_data[vi].setContent(CONTENT_IGNORE);
|
||||
}
|
||||
vi = vm->m_area.index(x, node_min.Y - 1, z); // bottom
|
||||
if (vm->m_data[vi].getContent() == c_stone) {
|
||||
vm->m_data[vi].setContent(CONTENT_IGNORE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MapgenV6::calculateNoise()
|
||||
{
|
||||
|
|
|
@ -125,6 +125,7 @@ public:
|
|||
void makeChunk(BlockMakeData *data);
|
||||
int getGroundLevelAtPoint(v2s16 p);
|
||||
int getSpawnLevelAtPoint(v2s16 p);
|
||||
virtual void removeOvergeneratedCStone();
|
||||
|
||||
float baseTerrainLevel(float terrain_base, float terrain_higher,
|
||||
float steepness, float height_select);
|
||||
|
|
|
@ -379,6 +379,8 @@ void MapgenV7::makeChunk(BlockMakeData *data)
|
|||
calcLighting(node_min - v3s16(0, 1, 0), node_max + v3s16(0, 1, 0),
|
||||
full_node_min, full_node_max, propagate_shadow);
|
||||
|
||||
removeOvergeneratedCStone();
|
||||
|
||||
this->generating = false;
|
||||
|
||||
//printf("makeChunk: %lums\n", t.stop());
|
||||
|
|
|
@ -271,6 +271,8 @@ void MapgenValleys::makeChunk(BlockMakeData *data)
|
|||
calcLighting(node_min - v3s16(0, 1, 0), node_max + v3s16(0, 1, 0),
|
||||
full_node_min, full_node_max);
|
||||
|
||||
removeOvergeneratedCStone();
|
||||
|
||||
this->generating = false;
|
||||
|
||||
//printf("makeChunk: %lums\n", t.stop());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue