Had to update everything to use Config::path_to for Config::BASE_DIR loading.

This commit is contained in:
Zed A. Shaw 2025-05-13 01:17:24 -04:00
parent eda7c30fc1
commit 2ef5a52928
5 changed files with 19 additions and 14 deletions

View file

@ -1,5 +1,5 @@
#include "guecs/sfml/shaders.hpp"
#include "guecs/sfml/config.hpp"
#include "shaders.hpp"
#include "config.hpp"
#include "dbc.hpp"
#include <SFML/Graphics/Image.hpp>
#include <fmt/core.h>
@ -17,9 +17,10 @@ namespace shaders {
}
bool load_shader(std::string name, nlohmann::json& settings) {
std::string file_name = settings["file_name"];
auto file_name = settings["file_name"];
auto file_path = Config::path_to(file_name);
auto ptr = std::make_shared<sf::Shader>();
bool good = ptr->loadFromFile(file_name, sf::Shader::Type::Fragment);
bool good = ptr->loadFromFile(file_path, sf::Shader::Type::Fragment);
if(good) {
configure_shader_defaults(ptr);