Had to update everything to use Config::path_to for Config::BASE_DIR loading.
This commit is contained in:
parent
eda7c30fc1
commit
2ef5a52928
5 changed files with 19 additions and 14 deletions
10
sound.cpp
10
sound.cpp
|
@ -1,5 +1,5 @@
|
|||
#include "guecs/sfml/sound.hpp"
|
||||
#include "guecs/sfml/config.hpp"
|
||||
#include "sound.hpp"
|
||||
#include "config.hpp"
|
||||
#include "dbc.hpp"
|
||||
#include <fmt/core.h>
|
||||
|
||||
|
@ -31,14 +31,14 @@ namespace sound {
|
|||
Config assets("assets/config.json");
|
||||
|
||||
for(auto& el : assets["sounds"].items()) {
|
||||
load(el.key(), el.value());
|
||||
load(el.key(), Config::path_to(el.value()));
|
||||
}
|
||||
initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
void load(const std::string& name, const std::string& sound_path) {
|
||||
dbc::check(fs::exists(sound_path), fmt::format("sound file {} does not exist", sound_path));
|
||||
void load(const std::string& name, const std::filesystem::path& sound_path) {
|
||||
dbc::check(fs::exists(sound_path), fmt::format("sound file {} does not exist", sound_path.string()));
|
||||
|
||||
// create the buffer and keep in the buffer map
|
||||
auto buffer = make_shared<sf::SoundBuffer>(sound_path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue