randomness no more random
This commit is contained in:
		| @@ -9,6 +9,10 @@ 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); | ||||||
| 	m_blocks.Reset(BTYPE_AIR); | 	m_blocks.Reset(BTYPE_AIR); | ||||||
|  | 	int ratio = 0; | ||||||
|  |  | ||||||
|  | 	ratio = x * y % 7; | ||||||
|  |  | ||||||
|  |  | ||||||
| 	for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // Montagnes | 	for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // Montagnes | ||||||
| 		for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) { | 		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; | 	//int rnd = rand() % 15; | ||||||
| 	if (rnd == 4) | 	if (ratio == 1) | ||||||
| 		for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure | 		for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure | ||||||
| 			for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) { | 			for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) { | ||||||
| 				for (int iy = 0; iy < 14; ++iy) { | 				for (int iy = 0; iy < 14; ++iy) { | ||||||
| @@ -57,7 +61,7 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y | |||||||
| 							Structure(ix, iy, iz, 2); | 							Structure(ix, iy, iz, 2); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 	if (rnd == 3) | 	if (ratio == 3) | ||||||
| 		for (int ix = 0; ix < CHUNK_SIZE_Z; ++ix) // structure | 		for (int ix = 0; ix < CHUNK_SIZE_Z; ++ix) // structure | ||||||
| 			for (int iz = 0; iz < CHUNK_SIZE_X; ++iz) { | 			for (int iz = 0; iz < CHUNK_SIZE_X; ++iz) { | ||||||
| 				for (int iy = 0; iy < 14; ++iy) { | 				for (int iy = 0; iy < 14; ++iy) { | ||||||
| @@ -66,7 +70,7 @@ Chunk::Chunk(unsigned int x, unsigned int y, int64_t seed) : m_posX(x), m_posY(y | |||||||
| 							Structure(ix, iy, iz, 2); | 							Structure(ix, iy, iz, 2); | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 	if (rnd == 6) | 	if (ratio == 5) | ||||||
| 		for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure | 		for (int ix = 0; ix < CHUNK_SIZE_X; ++ix) // structure | ||||||
| 			for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) { | 			for (int iz = 0; iz < CHUNK_SIZE_Z; ++iz) { | ||||||
| 				for (int iy = 0; iy < 14; ++iy) { | 				for (int iy = 0; iy < 14; ++iy) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user