diff options
author | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-16 18:16:43 -0400 |
---|---|---|
committer | Andy Belle-Isle <drumsetmonkey@gmail.com> | 2019-09-16 18:16:43 -0400 |
commit | 0236eb7f6391c9d925dcaaddb8cb01ecfb7d5e55 (patch) | |
tree | fcc7ad078ec6e2eb0691ab1c4de2915ff6baed78 /src/engine.cpp | |
parent | bce8d0687f44def4b0171cd84bf1441fc4390e58 (diff) |
Render system is now decoupled from the world system
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index e38020d..a2d0e9b 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -45,7 +45,7 @@ int Engine::init(void) systems.add<InputSystem>(); systems.add<PlayerSystem>(entities); systems.add<WorldSystem>(); - systems.add<RenderSystem>(*(systems.system<WorldSystem>().get())); + systems.add<RenderSystem>(); systems.add<ScriptSystem>(entities, *(systems.system<WorldSystem>().get())); systems.add<PhysicsSystem>(); systems.configure(); @@ -57,13 +57,19 @@ int Engine::init(void) "it." << std::endl; } + // Initially update the world to send all systems world data + systems.update<WorldSystem>(0); return 0; } void Engine::logicLoop(void) { entityx::TimeDelta dt = 0; /**< Elapsed milliseconds since each loop */ - double elapsed = 0; + double elapsed = 1000; /**< Time elapsed since last logic loop. This + should be initialized to something larger + than our logic loop period (50ms), so + the logic loop is run during our first + loop. */ while (shouldRun()) { auto start = mc::now(); |