From 827f09031e2d3cc15e956b242774a4566e1403c1 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 7 Nov 2024 20:52:06 +0100 Subject: more WIP audio system --- src/crepe/system/AudioSystem.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/crepe/system/AudioSystem.cpp (limited to 'src/crepe/system/AudioSystem.cpp') diff --git a/src/crepe/system/AudioSystem.cpp b/src/crepe/system/AudioSystem.cpp new file mode 100644 index 0000000..93c0955 --- /dev/null +++ b/src/crepe/system/AudioSystem.cpp @@ -0,0 +1,24 @@ +#pragma once + +#include "AudioSystem.h" +#include "ComponentManager.h" + +#include "../api/AudioSource.h" + +using namespace crepe; +using namespace std; + +AudioSystem::AudioSystem(SoundContext & ctx) : ctx(ctx) {} + +void AudioSystem::update() { + vector> components = this->compmgr.get_components_by_type(); + + for (auto component_ref : components) { + AudioSource & component = component_ref.get(); + if (!component.active) continue; + + // TODO: fetch Sound instance from resourcemanager + // TODO: lots of state diffing + } +} + -- cgit v1.2.3