From 8e727a9ff7e262187d11ca2277ed8e5ba1ad0d2c Mon Sep 17 00:00:00 2001 From: EmaMaker Date: Fri, 11 Nov 2022 12:03:50 +0100 Subject: [PATCH] chunkgen: use correct variable for z coord --- src/chunkgenerator.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/chunkgenerator.cpp b/src/chunkgenerator.cpp index 7cf2716..e30333d 100644 --- a/src/chunkgenerator.cpp +++ b/src/chunkgenerator.cpp @@ -7,14 +7,14 @@ #include "OpenSimplexNoise.h" #include "utils.hpp" -#define GRASS_OFFSET 80 +#define GRASS_OFFSET 40 #define NOISE_GRASS_MULT 20 #define NOISE_DIRT_MULT 3 #define NOISE_DIRT_MIN 2 #define NOISE_DIRT_X_MULT 0.001f #define NOISE_DIRT_Z_MULT 0.001f -#define NOISE_GRASS_X_MULT 0.01f -#define NOISE_GRASS_Z_MULT 0.01f +#define NOISE_GRASS_X_MULT 0.035f +#define NOISE_GRASS_Z_MULT 0.035f void generatePyramid(Chunk::Chunk *chunk); void generateNoise(Chunk::Chunk *chunk); @@ -46,13 +46,13 @@ void generateNoise(Chunk::Chunk *chunk) { int x = i + CHUNK_SIZE * chunk->getPosition().x; int y = j + CHUNK_SIZE * chunk->getPosition().y; - int z = i + CHUNK_SIZE * chunk->getPosition().z; + int z = k + CHUNK_SIZE * chunk->getPosition().z; int d2 = k * CHUNK_SIZE + i; if (grassNoiseLUT[d2] == -1) grassNoiseLUT[d2] = GRASS_OFFSET + (int)((0.5 + noiseGen1.eval(x * NOISE_GRASS_X_MULT, z * NOISE_GRASS_Z_MULT) * NOISE_GRASS_MULT)); if (dirtNoiseLUT[d2] == -1) - dirtNoiseLUT[d2] = NOISE_DIRT_MIN + (int)((0.5 + noiseGen2.eval(x * NOISE_DIRT_Z_MULT, z * NOISE_DIRT_Z_MULT) * NOISE_DIRT_MULT)); + dirtNoiseLUT[d2] = NOISE_DIRT_MIN + (int)((0.5 + noiseGen2.eval(x * NOISE_DIRT_X_MULT, z * NOISE_DIRT_Z_MULT) * NOISE_DIRT_MULT)); int grassNoise = grassNoiseLUT[d2]; int dirtNoise = dirtNoiseLUT[d2];