blob: 9fdd7eb46590da270c6b2cef377ba5d0f164eb10 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#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
}
}
|