aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/system/AudioSystem.cpp
blob: 93c0955c0e5082a630108041d26fbf18cb4a1acb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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<reference_wrapper<AudioSource>> components = this->compmgr.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
	}
}