]> git.tdb.fi Git - libs/game.git/blobdiff - source/game/stage.cpp
Cosmetic fixes
[libs/game.git] / source / game / stage.cpp
index 5663a71fadf8b36e1db21267724cf3d27e9530c2..7cad5bc250873b9e8c265ce3aacb617a9c8abcdb 100644 (file)
@@ -1,4 +1,6 @@
 #include "stage.h"
+#include <msp/debug/demangle.h>
+#include <msp/strings/format.h>
 #include "accessguard.h"
 #include "camera.h"
 #include "root.h"
@@ -57,10 +59,20 @@ void Stage::tick(Time::TimeDelta dt)
 {
        {
 #ifdef DEBUG
-               AccessGuard::BlockForScope _block;;
+               AccessGuard::BlockForScope _block;
 #endif
                for(const auto &s: systems)
-                       s->tick(dt);
+               {
+                       System::Activator act(*s);
+                       try
+                       {
+                               s->tick(dt);
+                       }
+                       catch(const invalid_access &exc)
+                       {
+                               throw invalid_access(format("%s by %s", exc.what(), Debug::demangle(typeid(*s).name())));
+                       }
+               }
        }
 
        for(const auto &s: systems)