sound_manager.cpp 483 Bytes
Newer Older
Georg Schaefer's avatar
Georg Schaefer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <asset/asset.hpp>
#include <asset/asset_manager.hpp>
#include <audio/sound_manager.hpp>
#include <core/engine.hpp>

namespace gdw {
	sound_manager::sound_manager(engine& engine)
	: engine_(engine) {}

	sound_ptr sound_manager::load_new(const std::string& name){
		auto asset = engine_.asset_manager().load(name);
		if (!asset) {
			return sound_ptr();
		}
		auto& content = asset->content();
Thomas Eppers's avatar
Thomas Eppers committed
16
		return std::make_shared<const sound_file>(content.data(), content.size());
Georg Schaefer's avatar
Georg Schaefer committed
17
18
	}
}