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
|
@ -15,7 +15,9 @@ namespace textures {
|
|||
Config assets("assets/config.json");
|
||||
|
||||
for(auto& [name, settings] : assets["sprites"].items()) {
|
||||
auto texture = make_shared<sf::Texture>(settings["path"]);
|
||||
auto file_name = settings["path"];
|
||||
auto file_path = Config::path_to(file_name);
|
||||
auto texture = make_shared<sf::Texture>(file_path);
|
||||
|
||||
texture->setSmooth(assets["graphics"]["smooth_textures"]);
|
||||
auto sprite = make_shared<sf::Sprite>(*texture);
|
||||
|
@ -52,8 +54,9 @@ namespace textures {
|
|||
|
||||
sf::Image load_image(const std::string& filename) {
|
||||
sf::Image texture;
|
||||
bool good = texture.loadFromFile(filename);
|
||||
dbc::check(good, fmt::format("failed to load {}", filename));
|
||||
auto file_path = Config::path_to(filename);
|
||||
bool good = texture.loadFromFile(file_path);
|
||||
dbc::check(good, fmt::format("failed to load {}", file_path.string()));
|
||||
return texture;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue