aboutsummaryrefslogtreecommitdiffstats
path: root/src/engine.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2019-09-02 15:15:26 -0400
committerClyne Sullivan <clyne@bitgloo.com>2019-09-02 15:15:26 -0400
commit46393662672f2510a40eb6cd5291f99a7ae14e3c (patch)
tree8b11793b474ebc6e7359289bd9e9704d58a7f58a /src/engine.cpp
parentc1161dc0d8939814abf7da48d03b887c0aead0ff (diff)
parent062a7e2baad74f49f2548793a25f0cf5e4ae6f86 (diff)
Merge branch 'master' of https://github.com/tcsullivan/gamedev2 into save-load
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index f235651..2916a6e 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -30,6 +30,10 @@
#include "components/Position.hpp"
#include "components/Velocity.hpp"
+using namespace std::chrono_literals;
+namespace cr = std::chrono;
+typedef std::chrono::high_resolution_clock mc;
+
int Engine::init(void)
{
systems.add<GameRunSystem>();
@@ -46,10 +50,6 @@ int Engine::init(void)
void Engine::logicLoop(void)
{
- using namespace std::chrono_literals;
- namespace cr = std::chrono;
- typedef std::chrono::high_resolution_clock mc;
-
entityx::TimeDelta dt = 0; /**< Elapsed milliseconds since each loop */
double elapsed = 0;
@@ -67,6 +67,7 @@ void Engine::logicLoop(void)
});
systems.update<InputSystem>(dt);
+ systems.update<ScriptSystem>(dt);
/*******************
* LOGIC UPDATES *
@@ -97,9 +98,9 @@ void Engine::logicLoop(void)
void Engine::renderLoop(void)
{
+ entityx::TimeDelta dt = 0; /**< Elapsed milliseconds since each loop */
while (shouldRun()) {
- systems.update<RenderSystem>(0);
- std::this_thread::yield();
+ systems.update<RenderSystem>(dt);
}
}