rétrécissement du monde
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,24 @@ 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)
|
||||
{
|
||||
if (x < nbReduit)
|
||||
m_chunks.Remove(x,y);
|
||||
if (y < nbReduit)
|
||||
m_chunks.Remove(x, y);
|
||||
if (y > WORLD_SIZE_Y - nbReduit)
|
||||
m_chunks.Remove(x, y);
|
||||
if (x > WORLD_SIZE_X - nbReduit)
|
||||
m_chunks.Remove(x, y);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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