Merge pull request #32 from CegepSTH/SQC-35_nouvelles_structures

Sqc 35 nouvelles structures
This commit is contained in:
MarcEricMartel 2023-12-02 14:59:21 -05:00 committed by GitHub
commit b2c73c930e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,10 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
//if (input.fail()) {
OpenSimplexNoise::Noise simplex = OpenSimplexNoise::Noise(seed);
m_blocks.Reset(BTYPE_AIR);
int ratio = 0;
ratio = x * y % 7;
for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // Montagnes
for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) {
@ -47,8 +51,8 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
}
}
int rnd = rand() % 15;
if (rnd == 4)
//int rnd = rand() % 15;
if (ratio == 1)
for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure
for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) {
for (int iy = 0; iy < 14; ++iy) {
@ -57,16 +61,16 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
Structure(ix, iy, iz, 2);
}
}
if (rnd == 3)
if (ratio == 3)
for (int ix = 0; ix < CHUNK_SIZE_Z; ++ix) // structure
for (int iz = 0; iz < CHUNK_SIZE_X; ++iz) {
for (int iy = 0; iy < 14; ++iy) {
if (iz == 4)
if (GetBlock(ix, iy, iz) == BTYPE_AIR)
Structure(ix, iy, iz, 2);
Structure(ix, iy, iz, 1);
}
}
if (rnd == 6)
if (ratio == 5)
for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure
for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) {
for (int iy = 0; iy < 14; ++iy) {