Revert "Cleanup engine"

This reverts commit d24d0aad54.
This commit is contained in:
Marc-Eric Martel 2021-11-02 17:36:42 -04:00
parent d24d0aad54
commit c6040fedaf
2 changed files with 11 additions and 14 deletions

View File

@ -47,30 +47,26 @@ void Engine::Init()
// Objet de musique!
m_audio.ToggleMusicState();
// Init Chunks
for (int chx = 0; chx < VIEW_DISTANCE; ++chx)
for (int chy = 0; chy < VIEW_DISTANCE; ++chy)
m_chunks.Set(chx, chy, new Chunk(chx, chy));
/*for (int x = 0; x < CHUNK_SIZE_X; ++x)
for (int z = 0; z < CHUNK_SIZE_Z; ++z)
for (int y = 0; y < 32; ++y)
m_testChunk->SetBlock(x, y, z, BTYPE_DIRT);*/
// Génération Chunks.
for (int chx = 0; chx < VIEW_DISTANCE; ++chx)
for (int chx = 0; chx < VIEW_DISTANCE; ++chx)
for (int chy = 0; chy < VIEW_DISTANCE; ++chy) {
m_chunks.Set(chx, chy, new Chunk(chx, chy));
for (int x = 0; x < CHUNK_SIZE_X; ++x)
for (int z = 0; z < CHUNK_SIZE_Z; ++z)
for (int y = 0; y < 32; ++y)
m_chunks.Get(chx, chy)->SetBlock(x, y, z, BTYPE_DIRT);
m_chunks.Get(chx,chy)->SetBlock(x, y, z, BTYPE_DIRT);
m_chunks.Get(chx,chy)->SetBlock(8, chx+32, 8, BTYPE_DIRT);
m_chunks.Get(chx, chy)->SetBlock(8, chx + 32, 8, BTYPE_DIRT);
}
// Consolidation Chunks.
for (int chx = 0; chx < VIEW_DISTANCE; ++chx)
for (int chy = 0; chy < VIEW_DISTANCE; ++chy)
m_chunks.Get(chx, chy)->Update(m_blockinfo);
// Gestion de souris.
CenterMouse();
HideCursor();

View File

@ -50,6 +50,7 @@ private:
Skybox m_skybox;
Shader m_shader01;
Chunk* m_testChunk;
Audio m_audio = Audio(AUDIO_PATH "music01.wav");
Player m_player = Player(Vector3f(0, 0, 0));