Re-Changement des textures.

This commit is contained in:
Louis-CharlesG 2023-12-04 16:17:59 -05:00
parent bb100fd5cb
commit d444b4de30

View File

@ -35,14 +35,14 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
if (iy < 20)
{
//std::cout << "" << ynoiz << std::endl;
SetBlock(ix, iy, iz, BTYPE_GREENGRASS, nullptr);
SetBlock(ix, iy, iz, BTYPE_GRASS, nullptr);
}
else if (iy == 20 || iy == 21) {
double fractionalPart = ynoiz - static_cast<int>(ynoiz);
if (iy == 20) {
if (fractionalPart < 0.3) {
SetBlock(ix, iy, iz, BTYPE_GREENGRASS, nullptr);
SetBlock(ix, iy, iz, BTYPE_GRASS, nullptr);
}
else {
SetBlock(ix, iy, iz, BTYPE_METAL, nullptr);
@ -50,7 +50,7 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
}
else if (iy == 21) {
if (fractionalPart < 0.6) {
SetBlock(ix, iy, iz, BTYPE_GREENGRASS, nullptr);
SetBlock(ix, iy, iz, BTYPE_GRASS, nullptr);
}
else {
SetBlock(ix, iy, iz, BTYPE_METAL, nullptr);
@ -138,7 +138,7 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
height /= (CHUNK_SIZE_Y / 1.9);
height += 15.;
if (GetBlock(ix, (int)height, iz) == BTYPE_GREENGRASS || (GetBlock(ix, (int)height, iz) == BTYPE_METAL)) {
if (GetBlock(ix, (int)height, iz) == BTYPE_DIRT || (GetBlock(ix, (int)height, iz) == BTYPE_METAL)) {
valeurRnd = simplex.eval(xnoiz, ynoiz);
int distanceThreshold = 20;
@ -222,7 +222,7 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
void Chunk::PlaceTree(int x, int y, int z, int height) {
for (int iy = 0; iy < height + 1; ++iy) {
SetBlock(x, y + iy, z, BTYPE_GRASS, nullptr);
SetBlock(x, y + iy, z, BTYPE_DIRT, nullptr);
}
int foliageHeight = height / 2;
@ -231,7 +231,7 @@ void Chunk::PlaceTree(int x, int y, int z, int height) {
for (int dx = -3; dx <= 3; ++dx) {
for (int dz = -3; dz <= 3; ++dz) {
if (dx * dx + dy * dy + dz * dz < 10) {
SetBlock(x + dx, y + height + dy, z + dz, BTYPE_DIRT, nullptr);
SetBlock(x + dx, y + height + dy, z + dz, BTYPE_GREENGRASS, nullptr);
}
}
}