Maintenant je comprend les singes au début de 2001 A Space Odyssey

This commit is contained in:
MarcEricMartel
2023-11-15 08:27:51 -05:00
parent e011e2f1fc
commit 86536fbb99
5 changed files with 48 additions and 13 deletions

View File

@@ -7,6 +7,32 @@ Renderer::Renderer() {
Renderer::~Renderer() {
}
void Renderer::RemoveChunk(int nbReduit)
{
for (int x = 0; x < WORLD_SIZE_X; ++x)
for (int y = 0; y < WORLD_SIZE_Y; ++y)
{
Mesh* chk = nullptr;
if (x < nbReduit)
chk = m_meshes.Remove(x, y);
if (y < nbReduit)
chk = m_meshes.Remove(x, y);
if (y > WORLD_SIZE_Y - nbReduit)
chk = m_meshes.Remove(x, y);
if (x > WORLD_SIZE_X - nbReduit)
chk = m_meshes.Remove(x, y);
// TODO: MakeDirty() les voisins pour qu'ils se redessinent.
if (!chk)
continue;
delete chk;
}
}
void Renderer::RenderWorld(World* origin, int& rendercount, const Vector3f& player_pos, const Vector3f& player_dir, Transformation& world, Shader& shader, TextureAtlas& atlas) const {
rendercount = 0;
Vector3f angle;