All the changes since last commit

This commit is contained in:
2022-12-26 20:50:14 -05:00
parent 360614e231
commit ac2c3b5c79
17 changed files with 127 additions and 75 deletions

View File

@@ -7,12 +7,10 @@
#include "TextureHandler.h"
#include <math.h>
#include <cstdio>
#include "FastNoiseLite.h"
#include <random>
#include <SFML/Window.hpp>
NodeRenderer renderer;
//BlockManager blockManager;
BlockManager blockManager;
TextureHandler textureHandler;
@@ -163,38 +161,9 @@ int main(int argc, char **argv)
// Load textures
textureHandler.loadAllTextures();
FastNoiseLite perlin, os, cellular;
int seed = 138;
perlin.SetSeed(seed);
perlin.SetNoiseType(FastNoiseLite::NoiseType_Perlin);
perlin.SetFrequency(.01F);
os.SetSeed(seed);
os.SetNoiseType(FastNoiseLite::NoiseType_OpenSimplex2);
os.SetFrequency(.01F);
cellular.SetSeed(seed);
cellular.SetNoiseType(FastNoiseLite::NoiseType_Cellular);
cellular.SetFrequency(.1F);
for(int bx = 0; bx < 8; bx++)
{
for(int bz = 0; bz < 8; bz++)
{
for(int x = 0; x < 16; x++)
{
for(int z = 0; z < 16; z++)
{
float cX = (float)x + (16 * bx);
float cZ = (float)z + (16 * bz);
for(int y = 0; y < 48 * abs(perlin.GetNoise(cX, cZ)) / 2 + abs(cellular.GetNoise(cX, cZ)) * 2 + abs(os.GetNoise(cX, cZ)) * 4 + 10; y++)
{
blockManager.mapBlocks[bx][bz].addNode(y > 20 ? 1 : 2, 0, x, y, z);
}
}
}
}
}