2-3 Corrections

This commit is contained in:
MarcEricMartel
2021-12-06 21:41:50 -05:00
parent 6e562f51c7
commit 3a363d06a3
3 changed files with 10 additions and 16 deletions

View File

@@ -6,7 +6,13 @@
Engine::Engine() { }
Engine::~Engine() { }
Engine::~Engine() {
m_world.CleanUpWorld(m_renderCount, true);
for (int x = 0; x < WORLD_SIZE_X; ++x) // Les destructeurs de Chunks ont de la mis<69>re, je les aide un peu!
for (int y = 0; y < WORLD_SIZE_Y; ++y)
if (m_world.GetChunks().Get(x, y))
m_world.GetChunks().Get(x, y)->~Chunk();
}
void Engine::Init() {
GLenum glewErr = glewInit();
@@ -209,12 +215,6 @@ void Engine::Render(float elapsedTime) {
void Engine::KeyPressEvent(unsigned char key) {
switch (key) {
case 36: // ESC
m_world.CleanUpWorld(m_renderCount, true);
for (int x = 0; x < WORLD_SIZE_X; ++x) // Les destructeurs de Chunks ont de la mis<69>re je les aide un peu!
for (int y = 0; y < WORLD_SIZE_Y; ++y)
if (m_world.GetChunks().Get(x,y))
m_world.GetChunks().Get(x, y)->~Chunk();
m_world.GetChunks().Reset(nullptr); // Hack cheap qui emp<6D>che d'avoir une exception en sortant du jeu
Stop();
break;
case 94: // F10