aboutsummaryrefslogtreecommitdiffstats
path: root/src/components.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/components.cpp')
-rw-r--r--src/components.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/components.cpp b/src/components.cpp
index 7506d40..cbec9fc 100644
--- a/src/components.cpp
+++ b/src/components.cpp
@@ -88,19 +88,24 @@ Texture RenderSystem::loadTexture(const std::string& file)
loadTexResult = Texture();
while (loadTexResult.isEmpty())
std::this_thread::sleep_for(1ms);
- return loadTexResult;
+ auto t = loadTexResult;
+ loadTexResult = Texture();
+ return t;
}
void RenderSystem::render(void)
{
if (!loadTexString.empty()) {
- loadTexResult = Texture(loadTexString);
+ loadTexResult = Texture(loadTexString, true);
loadTexString.clear();
}
Render::worldShader.use();
Render::worldShader.enable();
+ if (!loadTexResult.isEmpty())
+ return;
+
game::entities.lock();
game::entities.each<Visible, Sprite, Position>([](entityx::Entity entity, Visible &visible, Sprite &sprite, Position &pos) {
// Verticies and shit