Merge branch 'master' into SQC-35_nouvelles_structures
This commit is contained in:
		| @@ -16,6 +16,9 @@ void World::SetSeed(uint64_t seed) { | ||||
| 	m_seed = seed; | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| Chunk* World::ChunkAt(float x, float y, float z) const { | ||||
| 	int cx = (int)x / CHUNK_SIZE_X; | ||||
| 	int cz = (int)z / CHUNK_SIZE_Z; | ||||
| @@ -31,6 +34,32 @@ Chunk* World::ChunkAt(float x, float y, float z) const { | ||||
|  | ||||
| Chunk* World::ChunkAt(const Vector3f& pos) const { return ChunkAt(pos.x, pos.y, pos.z); } | ||||
|  | ||||
| void World::RemoveChunk(int nbReduit) | ||||
| { | ||||
| 	for (int x = 0; x < WORLD_SIZE_X; ++x) | ||||
| 		for (int y = 0; y < WORLD_SIZE_Y; ++y) | ||||
| 		{ | ||||
| 			Chunk* chk = nullptr; | ||||
| 			if (x < nbReduit) | ||||
| 				chk = m_chunks.Remove(x, y); | ||||
| 			if (y < nbReduit) | ||||
| 				chk = m_chunks.Remove(x, y); | ||||
| 			if (y > WORLD_SIZE_Y - nbReduit) | ||||
| 				chk = m_chunks.Remove(x, y); | ||||
| 			if (x > WORLD_SIZE_X - nbReduit) | ||||
| 				chk = m_chunks.Remove(x, y); | ||||
|  | ||||
| 			// TODO: MakeDirty() les voisins pour qu'ils se redessinent. | ||||
|  | ||||
| 			if (!chk) | ||||
| 				continue; | ||||
|  | ||||
| 			m_tbDeleted.emplace_back(chk); | ||||
| 		} | ||||
|  | ||||
|  | ||||
| } | ||||
|  | ||||
| BlockType World::BlockAt(float x, float y, float z, BlockType defaultBlockType) const { | ||||
| 	Chunk* c = ChunkAt(x, y, z); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user