Now mostly working with GUECS but shaders are still busted. Have to find out why they stopped working.
This commit is contained in:
parent
a5f6a82611
commit
ac22a11c9f
27 changed files with 162 additions and 1210 deletions
11
sound.cpp
11
sound.cpp
|
@ -1,7 +1,7 @@
|
|||
#include "sound.hpp"
|
||||
#include "guecs/sfml/sound.hpp"
|
||||
#include "guecs/sfml/config.hpp"
|
||||
#include "dbc.hpp"
|
||||
#include <fmt/core.h>
|
||||
#include "config.hpp"
|
||||
|
||||
namespace sound {
|
||||
static SoundManager SMGR;
|
||||
|
@ -28,7 +28,7 @@ namespace sound {
|
|||
|
||||
void init() {
|
||||
if(!initialized) {
|
||||
Config assets("./assets/config.json");
|
||||
Config assets("assets/config.json");
|
||||
|
||||
for(auto& el : assets["sounds"].items()) {
|
||||
load(el.key(), el.value());
|
||||
|
@ -38,11 +38,10 @@ namespace sound {
|
|||
}
|
||||
|
||||
void load(const std::string& name, const std::string& sound_path) {
|
||||
dbc::check(fs::exists(Config::path_to(sound_path)),
|
||||
fmt::format("sound file {} does not exist", sound_path));
|
||||
dbc::check(fs::exists(sound_path), fmt::format("sound file {} does not exist", sound_path));
|
||||
|
||||
// create the buffer and keep in the buffer map
|
||||
auto buffer = make_shared<sf::SoundBuffer>(Config::path_to(sound_path));
|
||||
auto buffer = make_shared<sf::SoundBuffer>(sound_path);
|
||||
|
||||
// set it on the sound and keep in the sound map
|
||||
auto sound = make_shared<sf::Sound>(*buffer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue