ajustement texture.

This commit is contained in:
Louis-CharlesG 2023-12-04 16:12:02 -05:00
parent a137666546
commit bb100fd5cb

View File

@ -10,7 +10,9 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
//if (input.fail()) { //if (input.fail()) {
OpenSimplexNoise::Noise simplex = OpenSimplexNoise::Noise(seed); OpenSimplexNoise::Noise simplex = OpenSimplexNoise::Noise(seed);
int ratio = 0;
ratio = x * y % 7;
m_blocks.Reset(BTYPE_AIR); m_blocks.Reset(BTYPE_AIR);
#pragma region Montagnes et Grass des montagnes #pragma region Montagnes et Grass des montagnes
@ -33,14 +35,14 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
if (iy < 20) if (iy < 20)
{ {
//std::cout << "" << ynoiz << std::endl; //std::cout << "" << ynoiz << std::endl;
SetBlock(ix, iy, iz, BTYPE_GRASS, nullptr); SetBlock(ix, iy, iz, BTYPE_GREENGRASS, nullptr);
} }
else if (iy == 20 || iy == 21) { else if (iy == 20 || iy == 21) {
double fractionalPart = ynoiz - static_cast<int>(ynoiz); double fractionalPart = ynoiz - static_cast<int>(ynoiz);
if (iy == 20) { if (iy == 20) {
if (fractionalPart < 0.3) { if (fractionalPart < 0.3) {
SetBlock(ix, iy, iz, BTYPE_GRASS, nullptr); SetBlock(ix, iy, iz, BTYPE_GREENGRASS, nullptr);
} }
else { else {
SetBlock(ix, iy, iz, BTYPE_METAL, nullptr); SetBlock(ix, iy, iz, BTYPE_METAL, nullptr);
@ -48,7 +50,7 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y
} }
else if (iy == 21) { else if (iy == 21) {
if (fractionalPart < 0.6) { if (fractionalPart < 0.6) {
SetBlock(ix, iy, iz, BTYPE_GRASS, nullptr); SetBlock(ix, iy, iz, BTYPE_GREENGRASS, nullptr);
} }
else { else {
SetBlock(ix, iy, iz, BTYPE_METAL, nullptr); SetBlock(ix, iy, iz, BTYPE_METAL, nullptr);
@ -136,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 /= (CHUNK_SIZE_Y / 1.9);
height += 15.; height += 15.;
if (GetBlock(ix, (int)height, iz) == BTYPE_GRASS || (GetBlock(ix, (int)height, iz) == BTYPE_METAL)) { if (GetBlock(ix, (int)height, iz) == BTYPE_GREENGRASS || (GetBlock(ix, (int)height, iz) == BTYPE_METAL)) {
valeurRnd = simplex.eval(xnoiz, ynoiz); valeurRnd = simplex.eval(xnoiz, ynoiz);
int distanceThreshold = 20; int distanceThreshold = 20;
@ -220,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) { void Chunk::PlaceTree(int x, int y, int z, int height) {
for (int iy = 0; iy < height + 1; ++iy) { for (int iy = 0; iy < height + 1; ++iy) {
SetBlock(x, y + iy, z, BTYPE_LAST, nullptr); SetBlock(x, y + iy, z, BTYPE_GRASS, nullptr);
} }
int foliageHeight = height / 2; int foliageHeight = height / 2;