aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2017-04-28 14:05:44 -0400
committerClyne Sullivan <tullivan99@gmail.com>2017-04-28 14:05:44 -0400
commitcbfec643e85c2ca6516195bec8df77c33525a87f (patch)
tree153e971f54527e495548a21cb2c43b9fcfe6d3a6 /src
parent22218cc26bfe6e1ad0b9edeaac79481685bcaef0 (diff)
mem fix; manager
Diffstat (limited to 'src')
-rw-r--r--src/render.cpp6
-rw-r--r--src/world.cpp2
2 files changed, 6 insertions, 2 deletions
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<PlayerSystem>()->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<ParticleSystem>()->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);