diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2020-05-09 09:40:59 -0400 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2020-05-09 09:40:59 -0400 |
commit | f461087223a80cd06619517e355690654f406d63 (patch) | |
tree | a5f5d573bec36f63284438c72157699f3a8fed98 /src/engine.cpp | |
parent | 1c52ee2e02bc3c09e7cac3b20c81c910b7151144 (diff) | |
parent | 3fb5e6b1eca24e536f8ab1130a7e4bd9c418fa41 (diff) |
Merge branch 'audio'
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 81e0272..dc0c481 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -19,6 +19,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +#include "audio.hpp" #include "config.hpp" #include "engine.hpp" #include "gamestate.hpp" @@ -54,6 +55,7 @@ int Engine::init(void) systems.add<ScriptSystem>(entities, *(systems.system<WorldSystem>().get())); systems.add<PhysicsSystem>(); systems.add<TextSystem>(); + systems.add<AudioSystem>(); systems.configure(); // Load game script and entity data @@ -64,6 +66,9 @@ int Engine::init(void) script->addToGameNamespace("puts", bindInstance(&TextSystem::put, systems.system<TextSystem>().get())); + script->addToGameNamespace("play", + bindInstance(&AudioSystem::playSound, + systems.system<AudioSystem>().get())); script->init(); @@ -115,6 +120,7 @@ void Engine::logicLoop(void) }); } + systems.update<AudioSystem>(dt); std::this_thread::yield(); } } |