summaryrefslogtreecommitdiff
path: root/servers/visual/rasterizer/rasterizer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/visual/rasterizer/rasterizer.cpp')
-rw-r--r--servers/visual/rasterizer/rasterizer.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/servers/visual/rasterizer/rasterizer.cpp b/servers/visual/rasterizer/rasterizer.cpp
index 647908c75f..64b5c88699 100644
--- a/servers/visual/rasterizer/rasterizer.cpp
+++ b/servers/visual/rasterizer/rasterizer.cpp
@@ -35,6 +35,31 @@
Rasterizer *(*Rasterizer::_create_func)() = NULL;
+void RasterizerScene::InstanceDependency::instance_notify_changed(bool p_aabb, bool p_dependencies) {
+ for (Map<InstanceBase *, uint32_t>::Element *E = instances.front(); E; E = E->next()) {
+ E->key()->dependency_changed(p_aabb, p_dependencies);
+ }
+}
+void RasterizerScene::InstanceDependency::instance_notify_deleted(RID p_deleted) {
+ for (Map<InstanceBase *, uint32_t>::Element *E = instances.front(); E; E = E->next()) {
+ E->key()->dependency_deleted(p_deleted);
+ }
+ for (Map<InstanceBase *, uint32_t>::Element *E = instances.front(); E; E = E->next()) {
+ E->key()->dependencies.erase(this);
+ }
+}
+
+RasterizerScene::InstanceDependency::~InstanceDependency() {
+#ifdef DEBUG_ENABLED
+ if (instances.size()) {
+ WARN_PRINT("Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.");
+ for (Map<InstanceBase *, uint32_t>::Element *E = instances.front(); E; E = E->next()) {
+ E->key()->dependencies.erase(this);
+ }
+ }
+#endif
+}
+
Rasterizer *Rasterizer::create() {
return _create_func();