]> git.tdb.fi Git - libs/game.git/blobdiff - source/game/system.cpp
Enforce correct access to buffered components
[libs/game.git] / source / game / system.cpp
index 33157c3946990c6c64b25b1b8b6f0ee8782f35da..4c1f4fbba01fa46ecc8b39c9a9dcb80172925c6b 100644 (file)
@@ -13,15 +13,27 @@ void System::begin_tick()
        active = this;
 
        for(const Dependency &d: dependencies)
+       {
+#ifdef DEBUG
+               if(d.unblock)
+                       d.unblock(d.flags);
+#endif
                if(d.prepare)
                        d.prepare(stage);
+       }
 }
 
 void System::end_tick()
 {
        for(const Dependency &d: dependencies)
+       {
                if(d.commit)
                        d.commit(stage);
+#ifdef DEBUG
+               if(d.block)
+                       d.block(d.flags);
+#endif
+       }
 
        if(active==this)
                active = nullptr;