Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pablode committed Jul 13, 2024
1 parent 464ee74 commit d8776d9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/libguc/src/cgltf_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,14 @@ namespace detail
{
TF_DEBUG(GUC).Msg("reading file %s\n", path);

ArResolver& resolver = ArGetResolver();
std::string identifier = resolver.CreateIdentifier(path);
//if (strlen(path)>1 && path[0]=='.' && path[1]=='/') path += 2;
// ArResolver fails to resolve paths with prefix "./" - we remove it.
fs::path relativePath = fs::relative(path);
//fs::path parentPath = fs::path(path).parent_path();
//fs::path relativePath = fs::relative(path, path);

ArResolver& resolver = ArGetResolver();
ArResolvedPath resolvedPath = resolver.Resolve(relativePath.string());
ArResolvedPath resolvedPath = resolver.Resolve(identifier);
if (!resolvedPath)
{
TF_RUNTIME_ERROR("unable to resolve %s", path);
Expand Down
9 changes: 6 additions & 3 deletions src/libguc/src/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,14 @@ namespace detail
{
TF_DEBUG(GUC).Msg("reading image %s\n", path);

//if (strlen(path)>1 && path[0]=='.' && path[1]=='/') path += 2;
// ArResolver fails to resolve paths with prefix "./" - we remove it.
fs::path relativePath = fs::relative(path);

//fs::path parentPath = fs::path(path).parent_path();
//fs::path relativePath = fs::path(path);//fs::relative(path, path);
ArResolver& resolver = ArGetResolver();
ArResolvedPath resolvedPath = resolver.Resolve(relativePath.string());
std::string identifier = resolver.CreateIdentifier(path);

ArResolvedPath resolvedPath = resolver.Resolve(identifier);
if (!resolvedPath)
{
TF_RUNTIME_ERROR("unable to resolve %s", path);
Expand Down

0 comments on commit d8776d9

Please sign in to comment.