diff --git a/src/project.cpp b/src/project.cpp index 6370808..81bb3bf 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -4,12 +4,15 @@ std::unique_ptr Project::fromFile(std::string path) { auto manifest = cpptoml::parse_file(path); auto basepath = filesystem::path(path).parent_path().make_absolute(); - return Project::fromToml(manifest, basepath); + + auto project = Project::fromToml(manifest, basepath); + return project; } std::unique_ptr Project::fromToml(std::shared_ptr manifest, filesystem::path basepath = filesystem::path(".")) { auto project = Project(); + project.basepath = basepath; project.name = manifest->get_qualified_as("project.name").value_or(""); project.shader_bundle = std::move(std::make_shared()); diff --git a/src/project.h b/src/project.h index f015175..1f577aa 100644 --- a/src/project.h +++ b/src/project.h @@ -35,6 +35,7 @@ public: std::shared_ptr current_scene; bool scene_loaded = false; std::string name; + filesystem::path basepath; std::shared_ptr shader_bundle; };