summaryrefslogtreecommitdiff
path: root/src/objects
diff options
context:
space:
mode:
Diffstat (limited to 'src/objects')
-rw-r--r--src/objects/object.cc2
-rw-r--r--src/objects/scene.cc4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/objects/object.cc b/src/objects/object.cc
index d648b63..4cf9790 100644
--- a/src/objects/object.cc
+++ b/src/objects/object.cc
@@ -209,7 +209,7 @@ auto Object::draw_internal(Engine *engine) -> void
for (Effect *effect : this->effects)
{
- effect->draw(engine);
+ if (effect->visible) effect->draw(engine);
}
}
diff --git a/src/objects/scene.cc b/src/objects/scene.cc
index 21a2449..b9728c7 100644
--- a/src/objects/scene.cc
+++ b/src/objects/scene.cc
@@ -57,6 +57,7 @@ auto Scene::get_object_by_id(u32 id) -> Object *
auto Scene::load(Engine *engine) -> void
{
+ /* NOTE: Removing objects here is known to cause issues.
if (this->objects.size() > 0)
{
for (auto it = this->objects.begin(); it != this->objects.end();)
@@ -65,6 +66,7 @@ auto Scene::load(Engine *engine) -> void
else it++;
}
}
+ */
for (Object *object : this->objects)
{
@@ -76,7 +78,7 @@ auto Scene::draw(Engine *engine) -> void
{
for (Object *object : this->objects)
{
- if (!object->loaded_as_dep) object->draw(engine);
+ if (!object->loaded_as_dep && object->visible) object->draw(engine);
}
}