From cbfec643e85c2ca6516195bec8df77c33525a87f Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 28 Apr 2017 14:05:44 -0400 Subject: mem fix; manager --- src/render.cpp | 6 ++++-- src/world.cpp | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/render.cpp b/src/render.cpp index 8c2f50d..8b99847 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -171,6 +171,8 @@ void preRender(void) Render::textShader.unuse(); } +extern std::size_t getUsedMem(void); +extern int balance; void render(const int& fps) { preRender(); @@ -187,10 +189,10 @@ void render(const int& fps) if (ui::debug) { auto pos = game::engine.getSystem()->getPosition(); UISystem::putText(vec2(offset.x - game::SCREEN_WIDTH / 2, (offset.y + game::SCREEN_HEIGHT / 2) - FontSystem::getSize()), - "loc: %s\noffset: %s\nfps: %d\nticks: %d\npcount: %d\nxml: %s", + "loc: %s\noffset: %s\nfps: %d\nticks: %d\npcount: %d\nxml: %s\nmem: %llukb (%d)", pos.toString().c_str(), offset.toString().c_str(), fps, game::time::getTickCount(), game::engine.getSystem()->getCount(), - WorldSystem::getXMLFile().c_str() + WorldSystem::getXMLFile().c_str(), getUsedMem() / 1024, balance ); } diff --git a/src/world.cpp b/src/world.cpp index e251706..e87d6d0 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -700,6 +700,8 @@ void WorldSystem::render(void) glDrawArrays(GL_TRIANGLES, 0, stars.size() * 6); } + delete[] star_coord; + Render::worldShader.disable(); glUniform4f(Render::worldShader.uniform[WU_tex_color], 1.0, 1.0, 1.0, 1.0); -- cgit v1.2.3