mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
Feature/filesystem cleanup (#1587)
* Adapting to the changes in Ghoul * First step of moving filesystem functions to std * Remove persistence flag from cachemanager
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
namespace {
|
||||
constexpr const char* _loggerCat = "GUI";
|
||||
@@ -53,7 +53,7 @@ namespace {
|
||||
constexpr const std::array<const char*, 2> UniformNames = { "tex", "ortho" };
|
||||
|
||||
void addScreenSpaceRenderableLocal(std::string identifier, std::string texturePath) {
|
||||
if (!FileSys.fileExists(absPath(texturePath))) {
|
||||
if (!std::filesystem::is_regular_file(absPath(texturePath))) {
|
||||
LWARNING(fmt::format("Could not find image '{}'", texturePath));
|
||||
return;
|
||||
}
|
||||
@@ -206,8 +206,7 @@ void GUI::deinitialize() {
|
||||
void GUI::initializeGL() {
|
||||
std::string cachedFile = FileSys.cacheManager()->cachedFilename(
|
||||
configurationFile,
|
||||
"",
|
||||
ghoul::filesystem::CacheManager::Persistent::Yes
|
||||
""
|
||||
);
|
||||
|
||||
LDEBUG(fmt::format("Using {} as ImGUI cache location", cachedFile));
|
||||
|
||||
@@ -30,9 +30,9 @@
|
||||
#include <openspace/engine/openspaceengine.h>
|
||||
#include <openspace/scene/assetmanager.h>
|
||||
#include <openspace/scene/asset.h>
|
||||
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <ghoul/filesystem/file.h>
|
||||
#include <filesystem>
|
||||
|
||||
namespace {
|
||||
std::string assetStateToString(openspace::Asset::State state) {
|
||||
@@ -90,10 +90,10 @@ void GuiAssetComponent::renderTree(const Asset& asset, const std::string& relati
|
||||
using namespace ghoul::filesystem;
|
||||
|
||||
std::string assetPath = asset.assetFilePath();
|
||||
const std::string& assetDirectory = File(assetPath).directoryName();
|
||||
std::string assetDirectory = std::filesystem::path(assetPath).parent_path().string();
|
||||
|
||||
if (!relativeToPath.empty()) {
|
||||
assetPath = FileSys.relativePath(assetPath, relativeToPath);
|
||||
assetPath = std::filesystem::relative(assetPath, relativeToPath).string();
|
||||
}
|
||||
|
||||
std::string assetText = assetPath + " " + assetStateToString(asset.state());
|
||||
|
||||
Reference in New Issue
Block a user