aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AudioSystem.cpp
blob: 67967ef4d3bd3b3fd56d00cad166863a9e595589 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "AudioSystem.h"
#include "ComponentManager.h"

#include "../api/AudioSource.h"

using namespace crepe;
using namespace std;

void AudioSystem::update() {
	ComponentManager & mgr = this->component_manager;
	vector<reference_wrapper<AudioSource>> components = mgr.get_components_by_type<AudioSource>();

	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
	}
}