]> git.tdb.fi Git - libs/game.git/blobdiff - source/game/stage.cpp
Implement base support for buffered components
[libs/game.git] / source / game / stage.cpp
index 81893e1e1ef8c27ca72db42e456c78462a999452..43446bd9d8e7af9ba6d03f5fd13d9a49d2e72d42 100644 (file)
@@ -1,4 +1,5 @@
 #include "stage.h"
+#include "accessguard.h"
 #include "camera.h"
 #include "root.h"
 #include "system.h"
@@ -7,7 +8,8 @@ using namespace std;
 
 namespace Msp::Game {
 
-Stage::Stage(DataFile::Collection &r):
+Stage::Stage(Reflection::Reflector &f, DataFile::Collection &r):
+       reflector(f),
        resources(r),
        event_source(event_bus),
        event_observer(event_bus),
@@ -53,8 +55,17 @@ void Stage::synthesize_initial_events(Handle<Entity> entity, EventObserver &targ
 
 void Stage::tick(Time::TimeDelta dt)
 {
-       for(const auto &s: systems)
-               s->tick(dt);
+       {
+#ifdef DEBUG
+               AccessGuard::BlockForScope _block;;
+#endif
+               for(const auto &s: systems)
+               {
+                       System::Activator act(*s);
+                       s->tick(dt);
+               }
+       }
+
        for(const auto &s: systems)
                s->deferred_tick();
 }